diff options
author | Robert Speicher <rspeicher@gmail.com> | 2012-09-26 21:43:42 +0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2012-09-27 00:32:26 +0400 |
commit | 7df25e77ac3cfd279a1b1937e45446574d932a3d (patch) | |
tree | 9ce28ce7456a9cb3779fd6a32654883c15f1b15c /spec | |
parent | f8c02f6e39d0a1f752583cc1942bb5e4c53df9c1 (diff) |
Speed up request specs a bit
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/gitlab_flavored_markdown_spec.rb | 4 | ||||
-rw-r--r-- | spec/requests/security/project_access_spec.rb | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/spec/requests/gitlab_flavored_markdown_spec.rb b/spec/requests/gitlab_flavored_markdown_spec.rb index bb00d9457f9..106f6451485 100644 --- a/spec/requests/gitlab_flavored_markdown_spec.rb +++ b/spec/requests/gitlab_flavored_markdown_spec.rb @@ -40,10 +40,9 @@ describe "Gitlab Flavored Markdown" do project.add_access(@user, :read, :write) end - describe "for commits" do it "should render title in commits#index" do - visit project_commits_path(project, @branch_name) + visit project_commits_path(project, @branch_name, limit: 1) page.should have_link("##{issue.id}") end @@ -89,7 +88,6 @@ describe "Gitlab Flavored Markdown" do end end - describe "for issues" do before do @other_issue = Factory :issue, diff --git a/spec/requests/security/project_access_spec.rb b/spec/requests/security/project_access_spec.rb index 5f26b781044..060a276b740 100644 --- a/spec/requests/security/project_access_spec.rb +++ b/spec/requests/security/project_access_spec.rb @@ -51,7 +51,7 @@ describe "Application access" do end describe "GET /project_code/commits/master" do - subject { project_commits_path(project, project.root_ref) } + subject { project_commits_path(project, project.root_ref, limit: 1) } it { should be_allowed_for master } it { should be_allowed_for reporter } @@ -189,6 +189,11 @@ describe "Application access" do describe "GET /project_code/repository/branches" do subject { branches_project_repository_path(project) } + before do + # Speed increase + Project.any_instance.stub(:branches).and_return([]) + end + it { should be_allowed_for master } it { should be_allowed_for reporter } it { should be_denied_for :admin } @@ -200,6 +205,11 @@ describe "Application access" do describe "GET /project_code/repository/tags" do subject { tags_project_repository_path(project) } + before do + # Speed increase + Project.any_instance.stub(:tags).and_return([]) + end + it { should be_allowed_for master } it { should be_allowed_for reporter } it { should be_denied_for :admin } |