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 40 project.add_access(@user, :read, :write)
41 41 end
42 42  
43   -
44 43 describe "for commits" do
45 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 47 page.should have_link("##{issue.id}")
49 48 end
... ... @@ -89,7 +88,6 @@ describe "Gitlab Flavored Markdown" do
89 88 end
90 89 end
91 90  
92   -
93 91 describe "for issues" do
94 92 before do
95 93 @other_issue = Factory :issue,
... ...
spec/requests/security/project_access_spec.rb
... ... @@ -51,7 +51,7 @@ describe "Application access" do
51 51 end
52 52  
53 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 56 it { should be_allowed_for master }
57 57 it { should be_allowed_for reporter }
... ... @@ -189,6 +189,11 @@ describe "Application access" do
189 189 describe "GET /project_code/repository/branches" do
190 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 197 it { should be_allowed_for master }
193 198 it { should be_allowed_for reporter }
194 199 it { should be_denied_for :admin }
... ... @@ -200,6 +205,11 @@ describe "Application access" do
200 205 describe "GET /project_code/repository/tags" do
201 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 213 it { should be_allowed_for master }
204 214 it { should be_allowed_for reporter }
205 215 it { should be_denied_for :admin }
... ...