bump rspec-rails, remove deprecated rspec syntax

This commit is contained in:
Jonne Haß 2012-09-07 03:25:53 +02:00
parent e7b1edbef7
commit 088446e86e
15 changed files with 40 additions and 40 deletions

View file

@ -384,20 +384,20 @@ GEM
rpm_contrib (2.1.11) rpm_contrib (2.1.11)
newrelic_rpm (>= 3.1.1) newrelic_rpm (>= 3.1.1)
newrelic_rpm (>= 3.1.1) newrelic_rpm (>= 3.1.1)
rspec (2.10.0) rspec (2.11.0)
rspec-core (~> 2.10.0) rspec-core (~> 2.11.0)
rspec-expectations (~> 2.10.0) rspec-expectations (~> 2.11.0)
rspec-mocks (~> 2.10.0) rspec-mocks (~> 2.11.0)
rspec-core (2.10.1) rspec-core (2.11.1)
rspec-expectations (2.10.0) rspec-expectations (2.11.3)
diff-lcs (~> 1.1.3) diff-lcs (~> 1.1.3)
rspec-instafail (0.2.4) rspec-instafail (0.2.4)
rspec-mocks (2.10.1) rspec-mocks (2.11.2)
rspec-rails (2.10.1) rspec-rails (2.11.0)
actionpack (>= 3.0) actionpack (>= 3.0)
activesupport (>= 3.0) activesupport (>= 3.0)
railties (>= 3.0) railties (>= 3.0)
rspec (~> 2.10.0) rspec (~> 2.11.0)
ruby-debug (0.10.4) ruby-debug (0.10.4)
columnize (>= 0.1) columnize (>= 0.1)
ruby-debug-base (~> 0.10.4.0) ruby-debug-base (~> 0.10.4.0)

View file

@ -9,7 +9,7 @@ describe BlocksController do
it "creates a block" do it "creates a block" do
expect { expect {
post :create, :block => {:person_id => eve.person.id} post :create, :block => {:person_id => eve.person.id}
}.should change { alice.blocks.count }.by(1) }.to change { alice.blocks.count }.by(1)
end end
it "redirects back" do it "redirects back" do
@ -43,7 +43,7 @@ describe BlocksController do
it "removes a block" do it "removes a block" do
expect { expect {
delete :destroy, :id => @block.id delete :destroy, :id => @block.id
}.should change { alice.blocks.count }.by(-1) }.to change { alice.blocks.count }.by(-1)
end end
end end

View file

@ -124,7 +124,7 @@ describe LikesController do
like_count = Like.count like_count = Like.count
expect { expect {
delete :destroy, :format => :json, id_field => like2.target_id, :id => like2.id delete :destroy, :format => :json, id_field => like2.target_id, :id => like2.id
}.should raise_error(ActiveRecord::RecordNotFound) }.to raise_error(ActiveRecord::RecordNotFound)
Like.count.should == like_count Like.count.should == like_count

View file

@ -29,7 +29,7 @@ describe ResharesController do
it 'creates a reshare' do it 'creates a reshare' do
expect{ expect{
post_request! post_request!
}.should change(Reshare, :count).by(1) }.to change(Reshare, :count).by(1)
end end
it 'after save, calls add to streams' do it 'after save, calls add to streams' do

View file

@ -226,7 +226,7 @@ describe StatusMessagesController do
alice.save alice.save
expect{ expect{
@controller.remove_getting_started @controller.remove_getting_started
}.should change{ }.to change{
alice.reload.getting_started alice.reload.getting_started
}.from(true).to(false) }.from(true).to(false)
end end
@ -234,7 +234,7 @@ describe StatusMessagesController do
it 'does nothing for returning users' do it 'does nothing for returning users' do
expect{ expect{
@controller.remove_getting_started @controller.remove_getting_started
}.should_not change{ }.to_not change{
alice.reload.getting_started alice.reload.getting_started
} }
end end

View file

@ -83,7 +83,7 @@ describe NotificationsHelper do
context 'when post is deleted' do context 'when post is deleted' do
it 'works' do it 'works' do
@post.destroy @post.destroy
expect{ object_link(@notification, notification_people_link(@notification))}.should_not raise_error expect{ object_link(@notification, notification_people_link(@notification))}.to_not raise_error
end end
it 'displays that the post was deleted' do it 'displays that the post was deleted' do

View file

@ -88,7 +88,7 @@ describe "attack vectors" do
expect_error /Contact required/ do expect_error /Contact required/ do
zord.perform! zord.perform!
end end
}.should_not change(Post, :count) }.to_not change(Post, :count)
user_should_not_see_guid(bob, bad_post_guid) user_should_not_see_guid(bob, bad_post_guid)
end end
@ -128,7 +128,7 @@ describe "attack vectors" do
expect_error /Author does not match XML author/ do expect_error /Author does not match XML author/ do
receive(profile, :from => alice, :by => bob) receive(profile, :from => alice, :by => bob)
end end
}.should_not change(eve.profile, :first_name) }.to_not change(eve.profile, :first_name)
end end
end end
@ -154,7 +154,7 @@ describe "attack vectors" do
expect{ expect{
receive(malicious_message, :from => alice, :by => bob) receive(malicious_message, :from => alice, :by => bob)
}.should_not change(original_message, :author_id) }.to_not change(original_message, :author_id)
end end
it 'does not save a message over an old message with the same author' do it 'does not save a message over an old message with the same author' do
@ -167,7 +167,7 @@ describe "attack vectors" do
expect { expect {
receive(malicious_message, :from => eve, :by => bob) receive(malicious_message, :from => eve, :by => bob)
}.should_not change(original_message, :text) }.to_not change(original_message, :text)
end end
end end
@ -183,7 +183,7 @@ describe "attack vectors" do
expect { expect {
receive(ret, :from => alice, :by => bob) receive(ret, :from => alice, :by => bob)
}.should_not change(StatusMessage, :count) }.to_not change(StatusMessage, :count)
end end
it "silently disregards retractions for non-existent posts(that are from someone other than the post's author)" do it "silently disregards retractions for non-existent posts(that are from someone other than the post's author)" do
@ -196,7 +196,7 @@ describe "attack vectors" do
end end
expect{ expect{
receive(bogus_retraction, :from => alice, :by => bob) receive(bogus_retraction, :from => alice, :by => bob)
}.should_not raise_error }.to_not raise_error
end end
it 'should not receive retractions where the retractor and the salmon author do not match' do it 'should not receive retractions where the retractor and the salmon author do not match' do
@ -212,7 +212,7 @@ describe "attack vectors" do
expect_error /Author does not match XML author/ do expect_error /Author does not match XML author/ do
receive(retraction, :from => alice, :by => bob) receive(retraction, :from => alice, :by => bob)
end end
}.should_not change(bob.visible_shareables(Post), :count) }.to_not change(bob.visible_shareables(Post), :count)
end end
@ -228,7 +228,7 @@ describe "attack vectors" do
expect{ expect{
receive(retraction, :from => alice, :by => bob) receive(retraction, :from => alice, :by => bob)
}.should_not change{bob.reload.contacts.count} }.to_not change{bob.reload.contacts.count}
end end
it 'it should not allow you to send retractions with xml and salmon handle mismatch' do it 'it should not allow you to send retractions with xml and salmon handle mismatch' do
@ -242,7 +242,7 @@ describe "attack vectors" do
expect_error /Author does not match XML author/ do expect_error /Author does not match XML author/ do
receive(retraction, :from => alice, :by => bob) receive(retraction, :from => alice, :by => bob)
end end
}.should_not change(bob.contacts, :count) }.to_not change(bob.contacts, :count)
end end
it 'does not let another user update other persons post' do it 'does not let another user update other persons post' do
@ -256,7 +256,7 @@ describe "attack vectors" do
expect{ expect{
receive(new_message, :from => alice, :by => bob) receive(new_message, :from => alice, :by => bob)
}.should_not change(original_message, :text) }.to_not change(original_message, :text)
end end
end end
end end

View file

@ -23,7 +23,7 @@ describe "i18n interpolation fallbacks" do
I18n.t('ago').should == "%{time} ago" I18n.t('ago').should == "%{time} ago"
end end
it "raises a MissingInterpolationArgument when arguments are wrong" do it "raises a MissingInterpolationArgument when arguments are wrong" do
expect { I18n.t('ago', :not_time => "2 months") }.should raise_exception(I18n::MissingInterpolationArgument) expect { I18n.t('ago', :not_time => "2 months") }.to raise_exception(I18n::MissingInterpolationArgument)
end end
end end
context "current locale falls back to English" do context "current locale falls back to English" do
@ -55,7 +55,7 @@ describe "i18n interpolation fallbacks" do
describe "when the English translation does not work" do describe "when the English translation does not work" do
it "raises a MissingInterpolationArgument" do it "raises a MissingInterpolationArgument" do
I18n.backend.store_translations('en', {"nonexistant_key" => "%{random_key} also required, so this will fail"}) I18n.backend.store_translations('en', {"nonexistant_key" => "%{random_key} also required, so this will fail"})
expect { I18n.t('nonexistant_key', :hey => "what") }.should raise_exception(I18n::MissingInterpolationArgument) expect { I18n.t('nonexistant_key', :hey => "what") }.to raise_exception(I18n::MissingInterpolationArgument)
end end
end end
end end

View file

@ -42,7 +42,7 @@ describe Postzord::Dispatcher do
it 'raises and gives you a helpful message if the object can not federate' do it 'raises and gives you a helpful message if the object can not federate' do
expect { expect {
Postzord::Dispatcher.build(alice, []) Postzord::Dispatcher.build(alice, [])
}.should raise_error /Diaspora::Federated::Base/ }.to raise_error /Diaspora::Federated::Base/
end end
end end

View file

@ -51,7 +51,7 @@ describe Salmon::Slap do
parsed_salmon.author_id = 'tom@tom.joindiaspora.com' parsed_salmon.author_id = 'tom@tom.joindiaspora.com'
expect { expect {
parsed_salmon.author.public_key parsed_salmon.author.public_key
}.should raise_error "did you remember to async webfinger?" }.to raise_error "did you remember to async webfinger?"
end end
end end

View file

@ -32,7 +32,7 @@ describe AppConfig do
it "prints an error message and exits" do it "prints an error message and exits" do
expect { expect {
AppConfig.load! AppConfig.load!
}.should raise_error SystemExit }.to raise_error SystemExit
$stderr.rewind $stderr.rewind
$stderr.string.chomp.should_not be_blank $stderr.string.chomp.should_not be_blank
@ -57,7 +57,7 @@ describe AppConfig do
expect { expect {
AppConfig.load! AppConfig.load!
}.should raise_error SystemExit }.to raise_error SystemExit
$stderr.rewind $stderr.rewind
$stderr.string.should include("haven't set up") $stderr.string.should include("haven't set up")
@ -69,7 +69,7 @@ describe AppConfig do
expect { expect {
AppConfig.load! AppConfig.load!
}.should raise_error SystemExit }.to raise_error SystemExit
$stderr.rewind $stderr.rewind
$stderr.string.should include("file format has changed") $stderr.string.should include("file format has changed")
@ -82,7 +82,7 @@ describe AppConfig do
expect { expect {
AppConfig.load! AppConfig.load!
}.should raise_error SystemExit }.to raise_error SystemExit
$stderr.rewind $stderr.rewind
$stderr.string.should include("file format has changed") $stderr.string.should include("file format has changed")

View file

@ -246,13 +246,13 @@ describe Photo do
it 'is deleted with parent status message' do it 'is deleted with parent status message' do
expect { expect {
@status_message.destroy @status_message.destroy
}.should change(Photo, :count).by(-1) }.to change(Photo, :count).by(-1)
end end
it 'will delete parent status message if message is otherwise empty' do it 'will delete parent status message if message is otherwise empty' do
expect { expect {
@photo2.destroy @photo2.destroy
}.should change(StatusMessage, :count).by(-1) }.to change(StatusMessage, :count).by(-1)
end end
it 'will not delete parent status message if message had other content' do it 'will not delete parent status message if message had other content' do
@ -263,7 +263,7 @@ describe Photo do
expect { expect {
@photo2.status_message.reload @photo2.status_message.reload
@photo2.destroy @photo2.destroy
}.should_not change(StatusMessage, :count) }.to_not change(StatusMessage, :count)
end end
end end
end end

View file

@ -139,7 +139,7 @@ describe Reshare do
expect{ expect{
reshare.destroy reshare.destroy
}.should_not raise_error }.to_not raise_error
end end
end end

View file

@ -205,7 +205,7 @@ STR
expect{ expect{
@sm.create_mentions @sm.create_mentions
}.should_not raise_error }.to_not raise_error
end end
end end
describe '#mentioned_people' do describe '#mentioned_people' do

View file

@ -18,7 +18,7 @@ describe User do
expect{ expect{
user.reload.encryption_key user.reload.encryption_key
}.should_not raise_error }.to_not raise_error
end end
end end