diff options
author | Ariejan de Vroom <ariejan@ariejan.net> | 2011-12-08 04:07:02 +0400 |
---|---|---|
committer | Ariejan de Vroom <ariejan@ariejan.net> | 2011-12-08 04:07:02 +0400 |
commit | e4b1f38c272ae8a052d64024867d9bcaa8398ce1 (patch) | |
tree | 111bfdaaeb5ddfcba565a591f63e1afdcc65696d /spec | |
parent | 1a3af33fce8ce505dca2bf7af071091b2ff058a2 (diff) |
Added merge request dashboard, showing all merge requests assigned to
you across projects.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/user_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/merge_requests_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/user_merge_requests_spec.rb | 47 |
3 files changed, 50 insertions, 1 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 4e1f130887e..3a3ac7c9c80 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -6,6 +6,8 @@ describe User do it { should have_many(:users_projects) } it { should have_many(:issues) } it { should have_many(:assigned_issues) } + it { should have_many(:merge_requests) } + it { should have_many(:assigned_merge_requests) } end describe "Respond to" do diff --git a/spec/requests/merge_requests_spec.rb b/spec/requests/merge_requests_spec.rb index b03ab2190a7..bdbc890912e 100644 --- a/spec/requests/merge_requests_spec.rb +++ b/spec/requests/merge_requests_spec.rb @@ -50,7 +50,7 @@ describe "MergeRequests" do end describe "GET /merge_requests/new" do - before do + before do visit new_project_merge_request_path(project) fill_in "merge_request_title", :with => "Merge Request Title" select "master", :from => "merge_request_source_branch" diff --git a/spec/requests/user_merge_requests_spec.rb b/spec/requests/user_merge_requests_spec.rb new file mode 100644 index 00000000000..fb47f3dd4ab --- /dev/null +++ b/spec/requests/user_merge_requests_spec.rb @@ -0,0 +1,47 @@ +require 'spec_helper' + +describe "User MergeRequests" do + describe "GET /issues" do + before do + + login_as :user + + @project1 = Factory :project, + :path => "project1", + :code => "TEST1" + + @project2 = Factory :project, + :path => "project2", + :code => "TEST2" + + @project1.add_access(@user, :read, :write) + @project2.add_access(@user, :read, :write) + + @merge_request1 = Factory :merge_request, + :author => @user, + :assignee => @user, + :project => @project1 + + @merge_request2 = Factory :merge_request, + :author => @user, + :assignee => @user, + :project => @project2 + + visit merge_requests_path + end + + subject { page } + + it { should have_content(@merge_request1.title) } + it { should have_content(@merge_request1.project.name) } + it { should have_content(@merge_request1.target_branch) } + it { should have_content(@merge_request1.source_branch) } + it { should have_content(@merge_request1.assignee.name) } + + it { should have_content(@merge_request2.title) } + it { should have_content(@merge_request2.project.name) } + it { should have_content(@merge_request2.target_branch) } + it { should have_content(@merge_request2.source_branch) } + it { should have_content(@merge_request2.assignee.name) } + end +end |