Remove "should" from example descriptions in a couple of files.

This commit is contained in:
Tristan Dunn 2010-12-17 12:14:02 -05:00
parent 29ebbecf9a
commit b8343ef963
2 changed files with 15 additions and 15 deletions

View File

@ -6,34 +6,34 @@ describe Shoulda::Matchers::ActionController::RedirectToMatcher do
@controller = build_response { redirect_to '/some/url' }
end
it "should accept redirecting to that url" do
it "accepts redirecting to that url" do
@controller.should redirect_to('/some/url')
end
it "should reject redirecting to a different url" do
it "rejects redirecting to a different url" do
@controller.should_not redirect_to('/some/other/url')
end
it "should accept redirecting to that url in a block" do
it "accepts redirecting to that url in a block" do
@controller.should redirect_to('somewhere') { '/some/url' }
end
it "should reject redirecting to a different url in a block" do
it "rejects redirecting to a different url in a block" do
@controller.should_not redirect_to('somewhere else') { '/some/other/url' }
end
end
context "a controller that doesn't redirect" do
context "a controller that doesn't redirect" do
before do
@controller = build_response { render :text => 'hello' }
end
it "should reject redirecting to a url" do
it "rejects redirecting to a url" do
@controller.should_not redirect_to('/some/url')
end
end
it "should use the correct description when provided a block" do
it "provides the correct description when provided a block" do
matcher = redirect_to('somewhere else') { '/some/other/url' }
matcher.description.should == 'redirect to somewhere else'
end

View File

@ -20,42 +20,42 @@ describe Shoulda::Matchers::ActionMailer::HaveSentEmailMatcher do
after { ::ActionMailer::Base.deliveries.clear }
it "should accept based on the subject" do
it "accepts sent e-mail based on the subject" do
should have_sent_email.with_subject(/is spam$/)
matcher = have_sent_email.with_subject(/totally safe/)
matcher.matches?(nil)
matcher.failure_message.should =~ /Expected sent email with subject/
end
it "should accept based on a string sender" do
it "accepts sent e-mail based on a string sender" do
should have_sent_email.from('do-not-reply@example.com')
matcher = have_sent_email.from('you@example.com')
matcher.matches?(nil)
matcher.failure_message.should =~ /Expected sent email from/
end
it "should accept based on a regexp sender" do
it "accepts sent e-mail based on a regexp sender" do
should have_sent_email.from(/@example\.com/)
matcher = have_sent_email.from(/you@/)
matcher.matches?(nil)
matcher.failure_message.should =~ /Expected sent email from/
end
it "should accept based on the body" do
it "accepts sent e-mail based on the body" do
should have_sent_email.with_body(/is spam\./)
matcher = have_sent_email.with_body(/totally safe/)
matcher.matches?(nil)
matcher.failure_message.should =~ /Expected sent email with body/
end
it "should accept based on the recipient" do
it "accept sent e-mail based on the recipient" do
should have_sent_email.to('myself@me.com')
matcher = have_sent_email.to('you@example.com')
matcher.matches?(nil)
matcher.failure_message.should =~ /Expected sent email to/
end
it "should list all deliveries within failure message" do
it "lists all the deliveries within failure message" do
add_mail_to_deliveries
matcher = have_sent_email.to('you@example.com')
@ -63,13 +63,13 @@ describe Shoulda::Matchers::ActionMailer::HaveSentEmailMatcher do
matcher.failure_message.should =~ /Deliveries:\n"This is spam" to \["myself@me\.com"\]\n"This is spam" to \["myself@me\.com"\]/
end
it "should chain" do
it "allows chaining" do
should have_sent_email.with_subject(/spam/).from('do-not-reply@example.com').with_body(/spam/).to('myself@me.com')
should_not have_sent_email.with_subject(/ham/).from('you@example.com').with_body(/ham/).to('them@example.com')
end
end
it "should provide a detailed description of the e-mail expected to be sent" do
it "provides a detailed description of the e-mail expected to be sent" do
matcher = have_sent_email
matcher.description.should == 'send an email'
matcher = matcher.with_subject("Welcome!")