Skip to content

Commit

Permalink
Method calling order has changed in the find_* method so stub out the…
Browse files Browse the repository at this point in the history
…se calls.
  • Loading branch information
ugisozols authored and parndt committed Jul 25, 2012
1 parent 0093e89 commit fbe7825
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@
describe "#update" do
let(:additional_user) { FactoryGirl.create :refinery_user }
it "updates a user" do
Refinery::User.should_receive(:find).at_least(1).times{ additional_user }
Refinery::User.stub_chain(:includes, :find) { additional_user }
put "update", :id => additional_user.id.to_s, :user => {}
response.should be_redirect
end

context "when specifying plugins" do
it "won't allow to remove 'Users' plugin from self" do
Refinery::User.should_receive(:find).at_least(1).times{ logged_in_user }
Refinery::User.stub_chain(:includes, :find) { logged_in_user }
put "update", :id => logged_in_user.id.to_s, :user => {:plugins => ["some plugin"]}

flash[:error].should eq("You cannot remove the 'Users' plugin from the currently logged in account.")
Expand Down

0 comments on commit fbe7825

Please sign in to comment.