diff options
author | Semyon Pupkov <mail@semyonpupkov.com> | 2018-12-13 11:54:30 +0500 |
---|---|---|
committer | Semyon Pupkov <mail@semyonpupkov.com> | 2018-12-13 11:54:30 +0500 |
commit | f95505415949f163976c30d63a2b1b0be6e7ff77 (patch) | |
tree | 17149f1601fe1e590c0eeb7626a9e2f434c406a3 /spec | |
parent | 4d19a84b88ed4310f3772502fd040c24ba1d94e7 (diff) | |
download | gitlab-ce-f95505415949f163976c30d63a2b1b0be6e7ff77.tar.gz |
Fix warning already initialized constant LABEL_TITLES
spec/features/projects/labels/user_views_labels_spec.rb:7: warning: already initialized constant LABEL_TITLES
spec/features/issues/user_creates_issue_spec.rb:67: warning: previous definition of LABEL_TITLES was here
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/issues/user_creates_issue_spec.rb | 10 | ||||
-rw-r--r-- | spec/features/projects/labels/user_views_labels_spec.rb | 8 |
2 files changed, 11 insertions, 7 deletions
diff --git a/spec/features/issues/user_creates_issue_spec.rb b/spec/features/issues/user_creates_issue_spec.rb index 687a6f1eafc..830d56035aa 100644 --- a/spec/features/issues/user_creates_issue_spec.rb +++ b/spec/features/issues/user_creates_issue_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" describe "User creates issue" do @@ -64,10 +66,10 @@ describe "User creates issue" do end context "with labels" do - LABEL_TITLES = %w(bug feature enhancement).freeze + let(:label_titles) { %w(bug feature enhancement) } before do - LABEL_TITLES.each do |title| + label_titles.each do |title| create(:label, project: project, title: title) end end @@ -77,13 +79,13 @@ describe "User creates issue" do fill_in("Title", with: issue_title) click_button("Label") - click_link(LABEL_TITLES.first) + click_link(label_titles.first) click_button("Submit issue") expect(page).to have_content(issue_title) .and have_content(user.name) .and have_content(project.name) - .and have_content(LABEL_TITLES.first) + .and have_content(label_titles.first) end end end diff --git a/spec/features/projects/labels/user_views_labels_spec.rb b/spec/features/projects/labels/user_views_labels_spec.rb index 0cbeca4e392..2c8267764bd 100644 --- a/spec/features/projects/labels/user_views_labels_spec.rb +++ b/spec/features/projects/labels/user_views_labels_spec.rb @@ -1,13 +1,15 @@ +# frozen_string_literal: true + require "spec_helper" describe "User views labels" do set(:project) { create(:project_empty_repo, :public) } set(:user) { create(:user) } - LABEL_TITLES = %w[bug enhancement feature].freeze + let(:label_titles) { %w[bug enhancement feature] } before do - LABEL_TITLES.each { |title| create(:label, project: project, title: title) } + label_titles.each { |title| create(:label, project: project, title: title) } project.add_guest(user) sign_in(user) @@ -17,7 +19,7 @@ describe "User views labels" do it "shows all labels" do page.within('.other-labels .manage-labels-list') do - LABEL_TITLES.each { |title| expect(page).to have_content(title) } + label_titles.each { |title| expect(page).to have_content(title) } end end end |