Admins who haven't been approved can log in when must_approve_users is enabled

This commit is contained in:
Neil Lalonde 2013-08-06 16:51:29 -04:00
parent 57baf1f112
commit c74da0d262
2 changed files with 12 additions and 1 deletions

View file

@ -107,6 +107,17 @@ describe SessionController do
)
end
end
context "with an unapproved user who is an admin" do
before do
User.any_instance.stubs(:admin?).returns(true)
xhr :post, :create, login: user.email, password: 'myawesomepassword'
end
it 'sets a session id' do
session[:current_user_id].should == user.id
end
end
end
end