diff options
author | Jason Blanchard <jas.blanchard@gmail.com> | 2013-12-17 09:39:39 -0500 |
---|---|---|
committer | Jason Blanchard <jas.blanchard@gmail.com> | 2013-12-17 09:39:50 -0500 |
commit | 65448e2ff75a92409e246d8e9aae494bc4132457 (patch) | |
tree | 436d52d44eed376b3d1a8abf0d21ad4a4e6da582 /spec/features | |
parent | 9c668133dc4172509adb4fd797bad4b2b1dae6b0 (diff) | |
download | gitlab-ce-65448e2ff75a92409e246d8e9aae494bc4132457.tar.gz |
Added dropdown menus to issue#show page for assignee and milestone
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/issues_spec.rb | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb index bb0c4dbd5dd..e33684ed832 100644 --- a/spec/features/issues_spec.rb +++ b/spec/features/issues_spec.rb @@ -175,6 +175,84 @@ describe "Issues" do end end + describe 'update assignee from issue#show' do + let(:issue) { create(:issue, project: project, author: @user) } + + context 'by autorized user' do + + it 'with dropdown menu' do + visit project_issue_path(project, issue) + + find('.edit-issue.inline-update').select(project.team.members.first.name, from: 'issue_assignee_id') + click_button 'Update Issue' + + page.should have_content "currently assigned to" + page.has_select?('issue_assignee_id', :selected => project.team.members.first.name) + end + end + + context 'by unauthorized user' do + + let(:guest) { create(:user) } + + before :each do + project.team << [[guest], :guest] + issue.assignee = @user + issue.save + end + + it 'shows assignee text' do + logout + login_with guest + + visit project_issue_path(project, issue) + page.should have_content "currently assigned to #{issue.assignee.name}" + + end + end + + end + + describe 'update milestone from issue#show' do + let!(:issue) { create(:issue, project: project, author: @user) } + let!(:milestone) { create(:milestone, project: project) } + + context 'by authorized user' do + + it 'with dropdown menu' do + visit project_issue_path(project, issue) + + p find('.edit-issue.inline-update').text + + find('.edit-issue.inline-update').select(milestone.title, from: 'issue_milestone_id') + click_button 'Update Issue' + + page.should have_content "and attached to milestone" + page.has_select?('issue_assignee_id', :selected => milestone.title) + end + end + + context 'by unauthorized user' do + + let(:guest) { create(:user) } + + before :each do + project.team << [[guest], :guest] + issue.milestone = milestone + issue.save + end + + it 'shows milestone text' do + logout + login_with guest + + visit project_issue_path(project, issue) + + page.should have_content "attached to milestone #{milestone.title}" + end + end + end + def first_issue all("ul.issues-list li").first.text end |