Use ruby 2.x hash syntax

This commit is contained in:
Thibault Jouan
2014-04-01 10:48:18 +00:00
parent 712e9501a2
commit da96c4814a
52 changed files with 148 additions and 148 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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