diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-02-24 15:13:16 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-02-24 15:13:16 +0000 |
commit | 6096ba531e76fe0edb1e03527514f47170a50ea6 (patch) | |
tree | c79b58b04ca2e12c66a62e53587a08142efc0780 /spec/models/user_spec.rb | |
parent | 67a9b39bd672cdecee6af11cf021f8c05f957c85 (diff) | |
parent | b7822e944b75e97db31b1d56249058ee02ce198b (diff) |
Merge branch 'rails-3-develop' of ssh://git.mysociety.org/data/git/public/alaveteli into rails-3-develop
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r-- | spec/models/user_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 7dcd3ab8a..2245a024f 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -369,3 +369,21 @@ describe User, "when calculating if a user has exceeded the request limit" do end + +describe User do + + describe :banned? do + + it 'is banned if the user has ban_text' do + user = FactoryGirl.build(:user, :ban_text => 'banned') + expect(user).to be_banned + end + + it 'is not banned if the user has no ban_text' do + user = FactoryGirl.build(:user, :ban_text => '') + expect(user).to_not be_banned + end + + end + +end |