adds specs

This commit is contained in:
rgarcia
2015-09-05 22:02:02 +02:00
parent 0bca1c5b95
commit 9515ccc3a8
3 changed files with 81 additions and 0 deletions

View File

@@ -299,4 +299,25 @@ describe User do
end
end
describe "cache" do
let(:user) { create(:user) }
it "should expire cache with becoming a moderator" do
expect { create(:moderator, user: user) }
.to change { user.updated_at}
end
it "should expire cache with becoming an admin" do
expect { create(:administrator, user: user) }
.to change { user.updated_at}
end
it "should expire cache with becoming a veridied organization" do
create(:organization, user: user)
expect { user.organization.verify }
.to change { user.reload.updated_at}
end
end
end