Convert to Ruby 1.9 hash syntax
This commit is contained in:
parent
98e978a03b
commit
9fcd1cb5f8
|
@ -4,7 +4,7 @@ class SessionsController < Devise::SessionsController
|
|||
end
|
||||
|
||||
def create
|
||||
resource = warden.authenticate(:scope => resource_name)
|
||||
resource = warden.authenticate(scope: resource_name)
|
||||
if resource
|
||||
sign_in(resource_name, resource)
|
||||
render(json: resource)
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'test_helper'
|
|||
class AddressesControllerTest < ActionController::TestCase
|
||||
test 'should return latitude and longitude for a valid address' do
|
||||
stub_request(:get, "http://maps.google.com/maps/geo").
|
||||
with(:query => {:key => "REPLACE_WITH_YOUR_GOOGLE_KEY", :oe => "utf-8", :output => "xml", :q => "City Hall, Boston, MA"}).
|
||||
with(query: {key: "REPLACE_WITH_YOUR_GOOGLE_KEY", oe: "utf-8", output: "xml", q: "City Hall, Boston, MA"}).
|
||||
to_return(body: File.read(File.expand_path('../../fixtures/city_hall.kml', __FILE__)))
|
||||
get :show, address: 'City Hall', city_state: "Boston, MA"
|
||||
assert_not_nil assigns :address
|
||||
|
@ -11,10 +11,10 @@ class AddressesControllerTest < ActionController::TestCase
|
|||
|
||||
test 'should return an error for an invalid address' do
|
||||
stub_request(:get, "http://geocoder.us/service/csv/geocode").
|
||||
with(:query => {:address => ", "}).
|
||||
with(query: {address: ", "}).
|
||||
to_return(body: File.read(File.expand_path('../../fixtures/unknown_address.txt', __FILE__)))
|
||||
stub_request(:get, "http://maps.google.com/maps/geo").
|
||||
with(:query => {:key => "REPLACE_WITH_YOUR_GOOGLE_KEY", :oe => "utf-8", :output => "xml", :q => ", "}).
|
||||
with(query: {key: "REPLACE_WITH_YOUR_GOOGLE_KEY", oe: "utf-8", output: "xml", q: ", "}).
|
||||
to_return(body: File.read(File.expand_path('../../fixtures/unknown_address.kml', __FILE__)))
|
||||
get :show, address: '', city_state: ''
|
||||
assert_response :missing
|
||||
|
|
|
@ -10,7 +10,7 @@ class RemindersControllerTest < ActionController::TestCase
|
|||
@thing.user = @dan
|
||||
@thing.save!
|
||||
stub_request(:get, "http://maps.google.com/maps/geo").
|
||||
with(:query => {:key => "REPLACE_WITH_YOUR_GOOGLE_KEY", :ll => "42.383339,-71.049226", :oe => "utf-8", :output => "xml"}).
|
||||
with(query: {key: "REPLACE_WITH_YOUR_GOOGLE_KEY", ll: "42.383339,-71.049226", oe: "utf-8", output: "xml"}).
|
||||
to_return(body: File.read(File.expand_path('../../fixtures/geo.kml', __FILE__)))
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue