summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-03-28 20:59:13 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-03-28 20:59:13 +0000
commit55df9a70bf3fb7fffa7491d53d3cf643d61de1c8 (patch)
treee05fc8ee8d030e208abaa26272fceb1b06a87b94 /spec
parent3385696bcecd5bf9a68cd4130b8a79a0b3557c34 (diff)
parent5449296fd60b0d620eef64a875a0796712c7ac79 (diff)
downloadgitlab-ce-55df9a70bf3fb7fffa7491d53d3cf643d61de1c8.tar.gz
Merge branch 'functional-sidebar' into 'master'
Updates sidebar to use new dropdowns for issues and merge requests Fixes #12935, #13164 See merge request !3175
Diffstat (limited to 'spec')
-rw-r--r--spec/features/issues/filter_by_milestone_spec.rb2
-rw-r--r--spec/features/issues_spec.rb77
2 files changed, 27 insertions, 52 deletions
diff --git a/spec/features/issues/filter_by_milestone_spec.rb b/spec/features/issues/filter_by_milestone_spec.rb
index f6e33f651c4..d8e2ecb9feb 100644
--- a/spec/features/issues/filter_by_milestone_spec.rb
+++ b/spec/features/issues/filter_by_milestone_spec.rb
@@ -31,7 +31,7 @@ feature 'Issue filtering by Milestone', feature: true do
def filter_by_milestone(title)
find(".js-milestone-select").click
sleep 0.5
- find(".milestone-filter a", text: title).click
+ find(".milestone-filter .dropdown-content a", text: title).click
sleep 1
end
end
diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb
index e844e681ebf..db46657c36a 100644
--- a/spec/features/issues_spec.rb
+++ b/spec/features/issues_spec.rb
@@ -34,20 +34,7 @@ describe 'Issues', feature: true do
fill_in 'issue_title', with: 'bug 345'
fill_in 'issue_description', with: 'bug description'
end
-
- it 'does not change issue count' do
- expect { click_button 'Save changes' }.to_not change { Issue.count }
- end
-
- it 'should update issue fields' do
- click_button 'Save changes'
-
- expect(page).to have_content @user.name
- expect(page).to have_content 'bug 345'
- expect(page).to have_content project.name
- end
end
-
end
describe 'Editing issue assignee' do
@@ -70,7 +57,7 @@ describe 'Issues', feature: true do
click_button 'Save changes'
page.within('.assignee') do
- expect(page).to have_content 'None'
+ expect(page).to have_content 'No assignee - assign yourself'
end
expect(issue.reload.assignee).to be_nil
@@ -198,20 +185,26 @@ describe 'Issues', feature: true do
end
describe 'update assignee from issue#show' do
- let(:issue) { create(:issue, project: project, author: @user) }
+ let(:issue) { create(:issue, project: project, author: @user, assignee: @user) }
context 'by autorized user' do
- it 'with dropdown menu' do
+ it 'allows user to select unassigned', js: true do
visit namespace_project_issue_path(project.namespace, project, issue)
- find('.issuable-sidebar #issue_assignee_id').
- set project.team.members.first.id
- click_button 'Update Issue'
+ page.within('.assignee') do
+ expect(page).to have_content "#{@user.name}"
+ end
+
+ find('.block.assignee .edit-link').click
+ sleep 2 # wait for ajax stuff to complete
+ first('.dropdown-menu-user-link').click
+ sleep 2
+ page.within('.assignee') do
+ expect(page).to have_content 'No assignee'
+ end
- expect(page).to have_content 'Assignee'
- has_select?('issue_assignee_id',
- selected: project.team.members.first.name)
+ expect(issue.reload.assignee).to be_nil
end
end
@@ -221,8 +214,6 @@ describe 'Issues', feature: true do
before :each do
project.team << [[guest], :guest]
- issue.assignee = @user
- issue.save
end
it 'shows assignee text', js: true do
@@ -241,20 +232,23 @@ describe 'Issues', feature: true do
context 'by authorized user' do
- it 'with dropdown menu' do
- visit namespace_project_issue_path(project.namespace, project, issue)
- find('.issuable-sidebar').
- select(milestone.title, from: 'issue_milestone_id')
- click_button 'Update Issue'
+ it 'allows user to select unassigned', js: true do
+ visit namespace_project_issue_path(project.namespace, project, issue)
- expect(page).to have_content "Milestone changed to #{milestone.title}"
+ page.within('.milestone') do
+ expect(page).to have_content "None"
+ end
+ find('.block.milestone .edit-link').click
+ sleep 2 # wait for ajax stuff to complete
+ first('.dropdown-content li').click
+ sleep 2
page.within('.milestone') do
- expect(page).to have_content milestone.title
+ expect(page).to have_content 'None'
end
- has_select?('issue_assignee_id', selected: milestone.title)
+ expect(issue.reload.milestone).to be_nil
end
end
@@ -283,25 +277,6 @@ describe 'Issues', feature: true do
issue.assignee = user2
issue.save
end
-
- it 'allows user to remove assignee', js: true do
- visit namespace_project_issue_path(project.namespace, project, issue)
-
- page.within('.assignee') do
- expect(page).to have_content user2.name
- end
-
- find('.assignee .edit-link').click
- sleep 2 # wait for ajax stuff to complete
- first('.user-result').click
-
- page.within('.assignee') do
- expect(page).to have_content 'None'
- end
-
- sleep 2 # wait for ajax stuff to complete
- expect(issue.reload.assignee).to be_nil
- end
end
end