summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-08 11:02:13 +0100
committerGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-14 09:59:08 +0100
commit00155b6c694d7d9a016b532694f5049b70e9a4db (patch)
tree163cca9240dfef7aabbc8a5e9728a5f1253a9963
parentc80f34257dc389369801eb112506706d46051bb1 (diff)
downloadgitlab-ce-00155b6c694d7d9a016b532694f5049b70e9a4db.tar.gz
Suppress warning about missing `.gitlab-ci.yml` if builds are disabled
When user disables GitLab Ci Service in project's settings then warning about missing `.gitlab-ci.yml` file should be supressed. This a matter of user experience as stated in #3761 (closes #3761).
-rw-r--r--spec/features/commits_spec.rb28
1 files changed, 21 insertions, 7 deletions
diff --git a/spec/features/commits_spec.rb b/spec/features/commits_spec.rb
index 90739cd6a28..130a5016b55 100644
--- a/spec/features/commits_spec.rb
+++ b/spec/features/commits_spec.rb
@@ -60,15 +60,29 @@ describe "Commits" do
end
describe ".gitlab-ci.yml not found warning" do
- it "does not show warning" do
- visit ci_status_path(@commit)
- expect(page).not_to have_content ".gitlab-ci.yml not found in this commit"
+ context 'ci service enabled' do
+ it "does not show warning" do
+ visit ci_status_path(@commit)
+ expect(page).not_to have_content ".gitlab-ci.yml not found in this commit"
+ end
+
+ it "shows warning" do
+ stub_ci_commit_yaml_file(nil)
+ visit ci_status_path(@commit)
+ expect(page).to have_content ".gitlab-ci.yml not found in this commit"
+ end
end
- it "shows warning" do
- stub_ci_commit_yaml_file(nil)
- visit ci_status_path(@commit)
- expect(page).to have_content ".gitlab-ci.yml not found in this commit"
+ context 'ci service disabled' do
+ before do
+ allow_any_instance_of(GitlabCiService).to receive(:active).and_return(false)
+ stub_ci_commit_yaml_file(nil)
+ visit ci_status_path(@commit)
+ end
+
+ it 'does not show warning' do
+ expect(page).not_to have_content '.gitlab-ci.yml not found in this commit'
+ end
end
end
end