diff options
author | Vitaliy @blackst0ne Klachkov <blackst0ne.ru@gmail.com> | 2017-09-12 07:41:57 +1100 |
---|---|---|
committer | Vitaliy @blackst0ne Klachkov <blackst0ne.ru@gmail.com> | 2017-09-12 07:41:57 +1100 |
commit | c0b0e506e3bb713e5406c7f2052f01674f3d7dab (patch) | |
tree | 175eeca9f6ddc9cf843983aa37cb83a44ed9db9d /spec/features | |
parent | 5d952f756bcf0355fc5d86d819dfc6913c0ae351 (diff) | |
download | gitlab-ce-c0b0e506e3bb713e5406c7f2052f01674f3d7dab.tar.gz |
Replace the project/milestone.feature spinach test with an rspec analog
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/projects/milestones/user_interacts_with_labels_spec.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/features/projects/milestones/user_interacts_with_labels_spec.rb b/spec/features/projects/milestones/user_interacts_with_labels_spec.rb new file mode 100644 index 00000000000..f6a82f80d65 --- /dev/null +++ b/spec/features/projects/milestones/user_interacts_with_labels_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe 'User interacts with labels' do + let(:user) { create(:user) } + let(:project) { create(:project, namespace: user.namespace) } + let(:milestone) { create(:milestone, project: project, title: 'v2.2', description: '# Description header') } + let(:issue1) { create(:issue, project: project, title: 'Bugfix1', milestone: milestone) } + let(:issue2) { create(:issue, project: project, title: 'Bugfix2', milestone: milestone) } + let(:label_bug) { create(:label, project: project, title: 'bug') } + let(:label_feature) { create(:label, project: project, title: 'feature') } + let(:label_enhancement) { create(:label, project: project, title: 'enhancement') } + + before do + project.add_master(user) + sign_in(user) + + issue1.labels << [label_bug, label_feature] + issue2.labels << [label_bug, label_enhancement] + + visit(project_milestones_path(project)) + end + + it 'shows the list of labels', :js do + click_link('v2.2') + + page.within('.nav-sidebar') do + page.find(:xpath, "//a[@href='#tab-labels']").click + end + + expect(page).to have_selector('ul.manage-labels-list') + + wait_for_requests + + page.within('#tab-labels') do + expect(page).to have_content(label_bug.title) + expect(page).to have_content(label_enhancement.title) + expect(page).to have_content(label_feature.title) + end + end +end |