Use ruby 2.x hash syntax
This commit is contained in:
@@ -4,9 +4,9 @@ feature 'API sign in' do
|
||||
let(:user) { FactoryGirl.create(:user) }
|
||||
|
||||
def do_create
|
||||
post api_sessions_path, :format => :json, :session => {
|
||||
:email => user.email,
|
||||
:password => user.password
|
||||
post api_sessions_path, format: :json, session: {
|
||||
email: user.email,
|
||||
password: user.password
|
||||
}
|
||||
end
|
||||
|
||||
|
@@ -7,9 +7,9 @@ feature 'API cross origin request' do
|
||||
let(:origin) { 'http://origin.example/' }
|
||||
|
||||
background do
|
||||
post sessions_path, :session => {
|
||||
:email => user.email,
|
||||
:password => user.password
|
||||
post sessions_path, session: {
|
||||
email: user.email,
|
||||
password: user.password
|
||||
}
|
||||
end
|
||||
|
||||
@@ -17,7 +17,7 @@ feature 'API cross origin request' do
|
||||
@integration_session.send(
|
||||
:process,
|
||||
:options,
|
||||
api_playlists_path(:format => :json),
|
||||
api_playlists_path(format: :json),
|
||||
nil,
|
||||
{ 'Origin' => origin }
|
||||
)
|
||||
@@ -32,7 +32,7 @@ feature 'API cross origin request' do
|
||||
|
||||
scenario 'basic request' do
|
||||
# FIXME: replace with a more stable/generic action
|
||||
get api_playlists_path(:format => :json), nil, {
|
||||
get api_playlists_path(format: :json), nil, {
|
||||
'Origin' => origin
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ feature 'API cross origin request' do
|
||||
|
||||
scenario 'request without origin' do
|
||||
# FIXME: replace with a more stable/generic action
|
||||
get api_playlists_path(:format => :json)
|
||||
get api_playlists_path(format: :json)
|
||||
|
||||
response.headers['Access-Control-Allow-Origin'].should == ''
|
||||
end
|
||||
|
@@ -11,8 +11,8 @@ feature 'API playlists' do
|
||||
playlist = FactoryGirl.attributes_for :playlist
|
||||
|
||||
post api_playlists_path,
|
||||
:format => :json,
|
||||
:playlist => playlist
|
||||
format: :json,
|
||||
playlist: playlist
|
||||
|
||||
json = JSON response.body
|
||||
|
||||
|
@@ -8,20 +8,20 @@ feature 'API tracks' do
|
||||
end
|
||||
|
||||
scenario 'lists tracks' do
|
||||
track_1 = FactoryGirl.create(:track_with_sound, :name => 'Track 1')
|
||||
track_2 = FactoryGirl.create(:track, :name => 'Track 2')
|
||||
track_1 = FactoryGirl.create(:track_with_sound, name: 'Track 1')
|
||||
track_2 = FactoryGirl.create(:track, name: 'Track 2')
|
||||
|
||||
get api_tracks_path, :format => :json
|
||||
get api_tracks_path, format: :json
|
||||
|
||||
response.body.should == [
|
||||
{
|
||||
:id => track_1.id,
|
||||
:name => 'Track 1',
|
||||
:sound_url => api_sound_url(track_1.sound)
|
||||
id: track_1.id,
|
||||
name: 'Track 1',
|
||||
sound_url: api_sound_url(track_1.sound)
|
||||
},
|
||||
{
|
||||
:id => track_2.id,
|
||||
:name => 'Track 2'
|
||||
id: track_2.id,
|
||||
name: 'Track 2'
|
||||
}
|
||||
].to_json
|
||||
end
|
||||
|
Reference in New Issue
Block a user