Merge pull request #7 from finnlabs/feature/fix-specs

Stub the 'logged?' method for users, as the application_controller calls...
pull/6827/head
sschu 11 years ago
commit be87b2e255
  1. 5
      spec/controllers/principal_roles_controller_spec.rb

@ -40,6 +40,7 @@ describe PrincipalRolesController do
PrincipalRole.stub!(:new).and_return(@principal_role)
@user = mock_model User
@user.stub!(:valid?).and_return(true)
@user.stub!(:logged?).and_return(true)
Principal.stub!(:find).and_return(@user)
@principal_role.stub!(:role=)
@principal_role.stub!(:role).and_return(@global_role)
@ -120,7 +121,9 @@ describe PrincipalRolesController do
describe :delete do
before :each do
@principal_role.stub!(:principal_id).and_return(1)
Principal.stub(:find).and_return(mock_model User)
@user = mock_model User
@user.stub!(:logged?).and_return(true)
Principal.stub(:find).and_return(@user)
@principal_role.stub!(:destroy)
@params = {"id" => "1"}
end

Loading…
Cancel
Save