Skip to content

Commit

Permalink
fix test for builds redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
flyerhzm committed Jun 24, 2012
1 parent 4fb6184 commit a92f51e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions spec/controllers/builds_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
describe BuildsController do
before do
stubs_current_user

@repository = FactoryGirl.build_stubbed(:repository, name: "rails-brakeman.com", user: @user)
Repository.stubs(:find).with(@repository.id.to_s).returns(@repository)

add_ability
end

Expand All @@ -22,6 +19,7 @@
end

it "should redirect with repository_id" do
Repository.expects(:find).with(@repository.id.to_s).returns(@repository)
get :show, id: @build.id, repository_id: @repository.id
response.should redirect_to("/flyerhzm/rails-brakeman.com/builds/#{@build.id}")
end
Expand Down Expand Up @@ -50,6 +48,7 @@

context "GET :index" do
it "should redirect with repository_id" do
Repository.expects(:find).with(@repository.id.to_s).returns(@repository)
@repository.expects(:builds).returns(stub('builds', completed: []))

@ability.can :read, Build
Expand Down

0 comments on commit a92f51e

Please sign in to comment.