eliminated naming clash with Sorcery

This commit is contained in:
Hauke Klement
2015-02-23 10:39:04 +01:00
parent 2180c3878e
commit 466f8967e2
11 changed files with 35 additions and 15 deletions

View File

@@ -129,7 +129,7 @@ describe SessionsController do
context 'with an internal user' do
before(:each) do
allow(user).to receive(:external?).and_return(false)
allow(user).to receive(:external_user?).and_return(false)
allow(user).to receive(:forget_me!)
delete :destroy
end
@@ -146,7 +146,7 @@ describe SessionsController do
context 'with an external user' do
before(:each) do
allow(user).to receive(:external?).and_return(true)
allow(user).to receive(:external_user?).and_return(true)
delete :destroy
end

View File

@@ -17,6 +17,18 @@ describe ExternalUser do
end
end
describe '#external_user?' do
it 'is true' do
expect(user.external_user?).to be true
end
end
describe '#internal_user?' do
it 'is false' do
expect(user.internal_user?).to be false
end
end
describe '#teacher?' do
it 'is false' do
expect(FactoryGirl.build(:external_user).teacher?).to be false

View File

@@ -56,6 +56,18 @@ describe InternalUser do
end
end
describe '#external_user?' do
it 'is false' do
expect(user.external_user?).to be false
end
end
describe '#internal_user?' do
it 'is true' do
expect(user.internal_user?).to be true
end
end
describe '#teacher?' do
it 'is only true for teachers' do
expect(FactoryGirl.build(:admin).teacher?).to be false