Skip to content

Instantly share code, notes, and snippets.

@mergulhao
Created October 18, 2012 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mergulhao/3912774 to your computer and use it in GitHub Desktop.
Save mergulhao/3912774 to your computer and use it in GitHub Desktop.
Testing scopes with rspec
# -*- encoding : utf-8 -*-
require 'spec_helper'
describe User do
describe :scopes do
describe :want_email_notifications do
create!(:user__want) { {email_notifications: true} }
create!(:user__notwant) { {email_notifications: false} }
subject { User.want_email_notifications }
it { should include(user__want) }
it { should_not include(user__notwant) }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment