summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-09-07 14:40:42 +0100
committerFilipa Lacerda <filipa@gitlab.com>2017-09-07 14:40:59 +0100
commit2c4d57ffdf8e111bbbb5817d9fd1882fab770f21 (patch)
tree7378b84837f0c2a34774facfaf7e7d1c22658fe7
parente5e0acfc4dd65503b89e652beca5b973141c4032 (diff)
downloadgitlab-ce-37158-autodevops-banner.tar.gz
Updates tests and i18n37158-autodevops-banner
-rw-r--r--app/views/shared/_auto_devops_callout.html.haml2
-rw-r--r--spec/javascripts/user_callout_spec.js15
2 files changed, 4 insertions, 13 deletions
diff --git a/app/views/shared/_auto_devops_callout.html.haml b/app/views/shared/_auto_devops_callout.html.haml
index e4078034a5f..2f09c2fec87 100644
--- a/app/views/shared/_auto_devops_callout.html.haml
+++ b/app/views/shared/_auto_devops_callout.html.haml
@@ -9,7 +9,7 @@
%h4= _('Auto DevOps (Beta)')
%p= _('Auto DevOps can be activated for this project. It will automatically build, test, and deploy your application based on a predefined CI/CD configuration.')
%p
- #{s_('LearnMoreInThe|Learn more in the')}
+ #{s_('AutoDevOps|Learn more in the')}
= link_to _('Auto DevOps documentation'), help_page_path('topics/autodevops/index.md'), target: '_blank', rel: 'noopener noreferrer'
= link_to _('Enable in settings'), project_settings_ci_cd_path(@project, anchor: 'js-general-pipeline-settings'), class: 'btn btn-primary js-close-callout'
diff --git a/spec/javascripts/user_callout_spec.js b/spec/javascripts/user_callout_spec.js
index b64d4468ad5..69cb93bd850 100644
--- a/spec/javascripts/user_callout_spec.js
+++ b/spec/javascripts/user_callout_spec.js
@@ -35,24 +35,15 @@ describe('UserCallout', function () {
});
describe('Sets cookie with setCalloutPerProject', () => {
- let originalGon;
beforeEach(() => {
- originalGon = window.gon;
- window.gon = Object.assign({}, {
- project_url: 'http://localhost:3000/gitlab-org/gitlab-ce',
- });
+ spyOn(Cookies, 'set').and.callFake(() => {});
+ document.querySelector('.user-callout').setAttribute('data-project-path', 'foo/bar');
this.userCallout = new UserCallout({ setCalloutPerProject: true });
});
- afterEach(() => {
- window.gon = originalGon;
- });
-
it('sets a cookie when the user clicks the close button', () => {
this.userCalloutBtn.click();
- // Note the path of a cookie is not accessible via JS, we can not test for that
- // We can test if a cookie is set when an option is provided
- expect(Cookies.get(USER_CALLOUT_COOKIE)).toBe('true');
+ expect(Cookies.set).toHaveBeenCalledWith('user_callout_dismissed', 'true', Object({ expires: 365, path: 'foo/bar' }));
});
});
});