summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-12-08 15:05:01 +0200
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-12-08 15:05:01 +0200
commit8e0126e9ec676f1ec40bb1a3dcb811e6477fb8c6 (patch)
tree184a51bc00567f5502a03285c000aa8a26cdd7b2 /spec
parent2677bc3acb64a2e3a75a743bd9b5426c39decdef (diff)
parent2b896ea6cc7f125a6a86295f23df165d7ebe4259 (diff)
downloadgitlab-ce-8e0126e9ec676f1ec40bb1a3dcb811e6477fb8c6.tar.gz
Merge branch 'issue_dashboard' into improved_dashboard
Diffstat (limited to 'spec')
-rw-r--r--spec/models/user_spec.rb2
-rw-r--r--spec/requests/merge_requests_spec.rb2
-rw-r--r--spec/requests/user_issues_spec.rb55
-rw-r--r--spec/requests/user_merge_requests_spec.rb47
4 files changed, 105 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_issues_spec.rb b/spec/requests/user_issues_spec.rb
new file mode 100644
index 00000000000..bd29eae303d
--- /dev/null
+++ b/spec/requests/user_issues_spec.rb
@@ -0,0 +1,55 @@
+require 'spec_helper'
+
+describe "User Issues Dashboard" 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)
+
+ @issue1 = Factory :issue,
+ :author => @user,
+ :assignee => @user,
+ :project => @project1
+
+ @issue2 = Factory :issue,
+ :author => @user,
+ :assignee => @user,
+ :project => @project2
+
+ visit issues_path
+ end
+
+ subject { page }
+
+ it { should have_content(@issue1.title) }
+ it { should have_content(@issue1.project.name) }
+ it { should have_content(@issue1.assignee.name) }
+
+ it { should have_content(@issue2.title) }
+ it { should have_content(@issue2.project.name) }
+ it { should have_content(@issue2.assignee.name) }
+
+ it "should render atom feed via private token" do
+ logout
+ visit issues_path(:atom, :private_token => @user.private_token)
+
+ page.response_headers['Content-Type'].should have_content("application/atom+xml")
+ page.body.should have_selector("title", :text => "#{@user.name} issues")
+ page.body.should have_selector("author email", :text => @issue1.author_email)
+ page.body.should have_selector("entry summary", :text => @issue1.title)
+ page.body.should have_selector("author email", :text => @issue2.author_email)
+ page.body.should have_selector("entry summary", :text => @issue2.title)
+ end
+ end
+end
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