Created
November 6, 2011 12:14
-
-
Save MattHall/1342797 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe NewsletterSubscriber do | |
describe "validations" do | |
before(:each) do | |
NewsletterSubscriber.create(:email => "[email protected]") | |
end | |
it { should validate_presence_of(:email) } | |
it { should validate_uniqueness_of(:email) } | |
end | |
describe "confirmation token" do | |
it "should be created when the subscriber is created" do | |
@subscriber = NewsletterSubscriber.create(:email => "[email protected]") | |
@subscriber.reload | |
@subscriber.confirmation_token.should_not be_blank | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment