Commit 7df25e77ac3cfd279a1b1937e45446574d932a3d

Authored by Robert Speicher
1 parent f8c02f6e

Speed up request specs a bit

spec/requests/gitlab_flavored_markdown_spec.rb
@@ -40,10 +40,9 @@ describe "Gitlab Flavored Markdown" do @@ -40,10 +40,9 @@ describe "Gitlab Flavored Markdown" do
40 project.add_access(@user, :read, :write) 40 project.add_access(@user, :read, :write)
41 end 41 end
42 42
43 -  
44 describe "for commits" do 43 describe "for commits" do
45 it "should render title in commits#index" do 44 it "should render title in commits#index" do
46 - visit project_commits_path(project, @branch_name) 45 + visit project_commits_path(project, @branch_name, limit: 1)
47 46
48 page.should have_link("##{issue.id}") 47 page.should have_link("##{issue.id}")
49 end 48 end
@@ -89,7 +88,6 @@ describe "Gitlab Flavored Markdown" do @@ -89,7 +88,6 @@ describe "Gitlab Flavored Markdown" do
89 end 88 end
90 end 89 end
91 90
92 -  
93 describe "for issues" do 91 describe "for issues" do
94 before do 92 before do
95 @other_issue = Factory :issue, 93 @other_issue = Factory :issue,
spec/requests/security/project_access_spec.rb
@@ -51,7 +51,7 @@ describe "Application access" do @@ -51,7 +51,7 @@ describe "Application access" do
51 end 51 end
52 52
53 describe "GET /project_code/commits/master" do 53 describe "GET /project_code/commits/master" do
54 - subject { project_commits_path(project, project.root_ref) } 54 + subject { project_commits_path(project, project.root_ref, limit: 1) }
55 55
56 it { should be_allowed_for master } 56 it { should be_allowed_for master }
57 it { should be_allowed_for reporter } 57 it { should be_allowed_for reporter }
@@ -189,6 +189,11 @@ describe "Application access" do @@ -189,6 +189,11 @@ describe "Application access" do
189 describe "GET /project_code/repository/branches" do 189 describe "GET /project_code/repository/branches" do
190 subject { branches_project_repository_path(project) } 190 subject { branches_project_repository_path(project) }
191 191
  192 + before do
  193 + # Speed increase
  194 + Project.any_instance.stub(:branches).and_return([])
  195 + end
  196 +
192 it { should be_allowed_for master } 197 it { should be_allowed_for master }
193 it { should be_allowed_for reporter } 198 it { should be_allowed_for reporter }
194 it { should be_denied_for :admin } 199 it { should be_denied_for :admin }
@@ -200,6 +205,11 @@ describe "Application access" do @@ -200,6 +205,11 @@ describe "Application access" do
200 describe "GET /project_code/repository/tags" do 205 describe "GET /project_code/repository/tags" do
201 subject { tags_project_repository_path(project) } 206 subject { tags_project_repository_path(project) }
202 207
  208 + before do
  209 + # Speed increase
  210 + Project.any_instance.stub(:tags).and_return([])
  211 + end
  212 +
203 it { should be_allowed_for master } 213 it { should be_allowed_for master }
204 it { should be_allowed_for reporter } 214 it { should be_allowed_for reporter }
205 it { should be_denied_for :admin } 215 it { should be_denied_for :admin }