mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 02:24:47 +08:00
Convert a lot of :a => b to a: b and bring peace to the world
This commit is contained in:
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user