diff options
| author | James Lopez <james@jameslopez.es> | 2016-04-21 09:12:03 +0200 |
|---|---|---|
| committer | James Lopez <james@jameslopez.es> | 2016-04-21 09:12:03 +0200 |
| commit | 6865bc16f8974e80b1ae657d7330be30c12c21ad (patch) | |
| tree | 8c77aba2aa1dbc0bdbfc717fb43bb88757e6b309 /spec/features | |
| parent | 07f8ffbdaf2878fb97ae41a3e88ae5358e82dab7 (diff) | |
| download | gitlab-ce-6865bc16f8974e80b1ae657d7330be30c12c21ad.tar.gz | |
refactored specs, adding more scenarios
Diffstat (limited to 'spec/features')
| -rw-r--r-- | spec/features/issues/filter_by_labels_spec.rb | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/spec/features/issues/filter_by_labels_spec.rb b/spec/features/issues/filter_by_labels_spec.rb index 7944403f874..9696af4b006 100644 --- a/spec/features/issues/filter_by_labels_spec.rb +++ b/spec/features/issues/filter_by_labels_spec.rb @@ -4,23 +4,25 @@ feature 'Issue filtering by Labels', feature: true do let(:project) { create(:project, :public) } let!(:user) { create(:user)} let!(:label) { create(:label, project: project) } + let(:bug) { create(:label, project: project, title: 'bug') } + let(:feature) { create(:label, project: project, title: 'feature') } + let(:enhancement) { create(:label, project: project, title: 'enhancement') } before do - ['bug', 'feature', 'enhancement'].each do |title| - create(:label, - project: project, - title: title) - end + + bug = create(:label, project: project, title: 'bug') + feature = create(:label, project: project, title: 'feature') + enhancement = create(:label, project: project, title: 'enhancement') issue1 = create(:issue, title: "Bugfix1", project: project) - issue1.labels << project.labels.find_by(title: 'bug') + issue1.labels << bug issue2 = create(:issue, title: "Bugfix2", project: project) - issue2.labels << project.labels.find_by(title: 'bug') - issue2.labels << project.labels.find_by(title: 'enhancement') + issue2.labels << bug + issue2.labels << enhancement issue3 = create(:issue, title: "Feature1", project: project) - issue3.labels << project.labels.find_by(title: 'feature') + issue3.labels << feature project.team << [user, :master] login_as(user) @@ -122,13 +124,9 @@ feature 'Issue filtering by Labels', feature: true do sleep 2 end - it 'should show issue "Bugfix2" or "Feature1" in issues list' do - expect(page).to have_content "Bugfix2" - expect(page).to have_content "Feature1" - end - - it 'should not show "Bugfix1" in issues list' do + it 'should not show "Bugfix1" or "Feature1" in issues list' do expect(page).not_to have_content "Bugfix1" + expect(page).not_to have_content "Feature1" end it 'should show label "enhancement" and "feature" in filtered-labels' do @@ -141,7 +139,7 @@ feature 'Issue filtering by Labels', feature: true do end end - context 'filter by label enhancement or bug in issues list', js: true do + context 'filter by label enhancement and bug in issues list', js: true do before do page.find('.js-label-select').click sleep 0.5 @@ -151,9 +149,8 @@ feature 'Issue filtering by Labels', feature: true do sleep 2 end - it 'should show issue "Bugfix2" or "Bugfix1" in issues list' do + it 'should show issue "Bugfix2" in issues list' do expect(page).to have_content "Bugfix2" - expect(page).to have_content "Bugfix1" end it 'should not show "Feature1"' do |
