FIX: log only 1 'show email' record

This commit is contained in:
Régis Hanol
2014-12-29 11:50:36 +01:00
parent b48f04e772
commit bfbc49ef6f
2 changed files with 7 additions and 15 deletions

View File

@ -33,13 +33,13 @@ describe Admin::UsersController do
end
end
it "logs an enty for all email shown" do
it "logs only 1 enty" do
UserHistory.where(action: UserHistory.actions[:check_email], acting_user_id: @user.id).count.should == 0
xhr :get, :index, show_emails: "true"
data = ::JSON.parse(response.body)
UserHistory.where(action: UserHistory.actions[:check_email], acting_user_id: @user.id).count.should == data.length
UserHistory.where(action: UserHistory.actions[:check_email], acting_user_id: @user.id).count.should == 1
end
end