diff --git a/spec/components/email/styles_spec.rb b/spec/components/email/styles_spec.rb index 91b3cdbe5b4..846944a51bb 100644 --- a/spec/components/email/styles_spec.rb +++ b/spec/components/email/styles_spec.rb @@ -25,7 +25,7 @@ describe Email::Styles do end # Pending due to email effort @coding-horror made in d2fb2bc4c - pending "adds a max-width to images" do + skip "adds a max-width to images" do frag = basic_fragment("") expect(frag.at("img")["style"]).to match("max-width") end diff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rb index 5125433f33d..0a6857d69c3 100644 --- a/spec/components/pretty_text_spec.rb +++ b/spec/components/pretty_text_spec.rb @@ -41,7 +41,7 @@ describe PrettyText do end # see: https://github.com/sparklemotion/nokogiri/issues/1173 - pending 'allows html entities correctly' do + skip 'allows html entities correctly' do PrettyText.cook("ℵ£¢").should == "

ℵ£¢

" end diff --git a/spec/mailers/user_notifications_spec.rb b/spec/mailers/user_notifications_spec.rb index c166c758404..cdde34812ed 100644 --- a/spec/mailers/user_notifications_spec.rb +++ b/spec/mailers/user_notifications_spec.rb @@ -25,46 +25,56 @@ describe UserNotifications do end describe ".signup" do + subject { UserNotifications.signup(user) } - its(:to) { should == [user.email] } - its(:subject) { should be_present } - its(:from) { should == [SiteSetting.notification_email] } - its(:body) { should be_present } + it "works" do + subject.to.should == [user.email] + subject.subject.should be_present + subject.from.should == [SiteSetting.notification_email] + subject.body.should be_present + end + end describe ".forgot_password" do + subject { UserNotifications.forgot_password(user) } - its(:to) { should == [user.email] } - its(:subject) { should be_present } - its(:from) { should == [SiteSetting.notification_email] } - its(:body) { should be_present } + it "works" do + subject.to.should == [user.email] + subject.subject.should be_present + subject.from.should == [SiteSetting.notification_email] + subject.body.should be_present + end + end describe '.digest' do + subject { UserNotifications.digest(user) } context "without new topics" do - its(:to) { should be_blank } + + it "doesn't send the email" do + subject.to.should be_blank + end + end context "with new topics" do + before do Topic.expects(:for_digest).returns([Fabricate(:topic, user: Fabricate(:coding_horror))]) Topic.expects(:new_since_last_seen).returns(Topic.none) end - its(:to) { should == [user.email] } - its(:subject) { should be_present } - its(:from) { should == [SiteSetting.notification_email] } - - it 'should have a html body' do - subject.html_part.body.to_s.should be_present - end - - it 'should have a text body' do + it "works" do + subject.to.should == [user.email] + subject.subject.should be_present + subject.from.should == [SiteSetting.notification_email] subject.html_part.body.to_s.should be_present + subject.text_part.body.to_s.should be_present end end diff --git a/spec/mailers/version_mailer_spec.rb b/spec/mailers/version_mailer_spec.rb index eb0df5fbecf..0a98e9de6da 100644 --- a/spec/mailers/version_mailer_spec.rb +++ b/spec/mailers/version_mailer_spec.rb @@ -5,14 +5,21 @@ describe VersionMailer do context 'contact_email is blank' do before { SiteSetting.stubs(:contact_email).returns('') } - its(:to) { should be_blank } + + it "doesn't send the email" do + subject.to.should be_blank + end end context 'contact_email is set' do before { SiteSetting.stubs(:contact_email).returns('me@example.com') } - its(:to) { should == ['me@example.com'] } - its(:subject) { should be_present } - its(:from) { should == [SiteSetting.notification_email] } - its(:body) { should be_present } + + it "works" do + subject.to.should == ['me@example.com'] + subject.subject.should be_present + subject.from.should == [SiteSetting.notification_email] + subject.body.should be_present + end + end end diff --git a/spec/models/invite_spec.rb b/spec/models/invite_spec.rb index 0e146444f16..db3c0ee1acb 100644 --- a/spec/models/invite_spec.rb +++ b/spec/models/invite_spec.rb @@ -40,8 +40,11 @@ describe Invite do context 'saved' do subject { Fabricate(:invite) } - its(:invite_key) { should be_present } - its(:email_already_exists) { should == false } + + it "works" do + subject.invite_key.should be_present + subject.email_already_exists.should == false + end it 'should store a lower case version of the email' do subject.email.should == iceking diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 08281e04a6f..8cf56a5bd2b 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -206,10 +206,13 @@ describe User do it { should be_valid } it { should_not be_admin } it { should_not be_approved } - its(:approved_at) { should be_blank } - its(:approved_by_id) { should be_blank } - its(:email_private_messages) { should == true } - its(:email_direct ) { should == true } + + it "is properly initialized" do + subject.approved_at.should be_blank + subject.approved_by_id.should be_blank + subject.email_private_messages.should == true + subject.email_direct.should == true + end context 'digest emails' do it 'defaults to digests every week' do @@ -230,11 +233,11 @@ describe User do end context 'after_save' do - before do - subject.save - end + before { subject.save } - its(:email_tokens) { should be_present } + it "has an email token" do + subject.email_tokens.should be_present + end end it "downcases email addresses" do