Admins who haven't been approved can log in when must_approve_users is enabled
This commit is contained in:
parent
57baf1f112
commit
c74da0d262
2 changed files with 12 additions and 1 deletions
spec/controllers
|
@ -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
|
||||
|
||||
|
|
Reference in a new issue