Convert a lot of :a => b to a: b and bring peace to the world

This commit is contained in:
Karan Misra
2013-03-23 20:32:59 +05:30
parent cb9106c3a7
commit 5dfb04e4b3
62 changed files with 171 additions and 171 deletions

View File

@ -43,7 +43,7 @@ EXPECTED
before do
@topic = Fabricate(:topic)
@post = Fabricate.build(:post_with_image_url, topic: @topic, user: @topic.user)
@cpp = CookedPostProcessor.new(@post, :image_sizes => {'http://www.forumwarz.com/images/header/logo.png' => {'width' => 111, 'height' => 222}})
@cpp = CookedPostProcessor.new(@post, image_sizes: {'http://www.forumwarz.com/images/header/logo.png' => {'width' => 111, 'height' => 222}})
@cpp.expects(:get_size).returns([111,222])
end

View File

@ -374,11 +374,11 @@ describe Guardian do
it "isn't allowed if the user voted and the topic doesn't allow multiple votes" do
Topic.any_instance.expects(:has_meta_data_boolean?).with(:single_vote).returns(true)
Guardian.new(user).can_vote?(post, :voted_in_topic => true).should be_false
Guardian.new(user).can_vote?(post, voted_in_topic: true).should be_false
end
it "is allowed if the user voted and the topic doesn't allow multiple votes" do
Guardian.new(user).can_vote?(post, :voted_in_topic => false).should be_true
Guardian.new(user).can_vote?(post, voted_in_topic: false).should be_true
end
end

View File

@ -7,7 +7,7 @@ require 'oneboxer/amazon_onebox'
describe Oneboxer::AmazonOnebox do
before(:each) do
@o = Oneboxer::AmazonOnebox.new("http://www.amazon.com/Ruby-Programming-Language-David-Flanagan/dp/0596516177")
FakeWeb.register_uri(:get, @o.translate_url, :response => fixture_file('oneboxer/amazon.response'))
FakeWeb.register_uri(:get, @o.translate_url, response: fixture_file('oneboxer/amazon.response'))
end
it "translates the URL" do

View File

@ -7,7 +7,7 @@ require 'oneboxer/android_app_store_onebox'
describe Oneboxer::AndroidAppStoreOnebox do
before(:each) do
@o = Oneboxer::AndroidAppStoreOnebox.new("https://play.google.com/store/apps/details?id=com.moosoft.parrot")
FakeWeb.register_uri(:get, @o.translate_url, :response => fixture_file('oneboxer/android.response'))
FakeWeb.register_uri(:get, @o.translate_url, response: fixture_file('oneboxer/android.response'))
end
it "generates the expected onebox for Android App Store" do

View File

@ -7,7 +7,7 @@ require 'oneboxer/apple_app_onebox'
describe Oneboxer::AppleAppOnebox do
before(:each) do
@o = Oneboxer::AppleAppOnebox.new("https://itunes.apple.com/us/app/minecraft-pocket-edition-lite/id479651754")
FakeWeb.register_uri(:get, @o.translate_url, :response => fixture_file('oneboxer/apple.response'))
FakeWeb.register_uri(:get, @o.translate_url, response: fixture_file('oneboxer/apple.response'))
end
it "generates the expected onebox for Apple app" do

View File

@ -7,7 +7,7 @@ require 'oneboxer/flickr_onebox'
describe Oneboxer::FlickrOnebox do
before(:each) do
@o = Oneboxer::FlickrOnebox.new("http://www.flickr.com/photos/jaimeiniesta/3303881265")
FakeWeb.register_uri(:get, @o.translate_url, :response => fixture_file('oneboxer/flickr.response'))
FakeWeb.register_uri(:get, @o.translate_url, response: fixture_file('oneboxer/flickr.response'))
end
it "generates the expected onebox for Flickr" do

View File

@ -8,8 +8,8 @@ describe Oneboxer::WikipediaOnebox do
it "generates the expected onebox for Wikipedia" do
o = Oneboxer::WikipediaOnebox.new('http://en.wikipedia.org/wiki/Ruby')
FakeWeb.register_uri(:get, o.translate_url, :response => fixture_file('oneboxer/wikipedia.response'))
FakeWeb.register_uri(:get, 'http://en.m.wikipedia.org/wiki/Ruby', :response => fixture_file('oneboxer/wikipedia_redirected.response'))
FakeWeb.register_uri(:get, o.translate_url, response: fixture_file('oneboxer/wikipedia.response'))
FakeWeb.register_uri(:get, 'http://en.m.wikipedia.org/wiki/Ruby', response: fixture_file('oneboxer/wikipedia_redirected.response'))
o.onebox.should == expected_wikipedia_result
end