Update rails to 4.0:
* Add protected_attributes gem dependency; * Remove deprecated usages of AR .find method;
This commit is contained in:
@@ -9,7 +9,7 @@ describe API::ApplicationController do
|
||||
|
||||
context 'CORS: Cross-Origin Ressource Sharing' do
|
||||
before do
|
||||
request.env['Origin'] = 'http://origin.example/'
|
||||
request.headers['Origin'] = 'http://origin.example/'
|
||||
end
|
||||
|
||||
context 'preflight' do
|
||||
@@ -18,7 +18,7 @@ describe API::ApplicationController do
|
||||
end
|
||||
|
||||
def options(action)
|
||||
process action, nil, nil, nil, 'OPTIONS'
|
||||
process action, 'OPTIONS'
|
||||
end
|
||||
|
||||
it 'sets Access-Control-Allow-Methods header' do
|
||||
@@ -43,8 +43,8 @@ describe API::ApplicationController do
|
||||
|
||||
it 'sets Access-Control-Allow-Origin header' do
|
||||
get :index
|
||||
response.headers['Access-Control-Allow-Origin'].should ==
|
||||
request.env['Origin']
|
||||
response.headers['Access-Control-Allow-Origin']
|
||||
.should == request.headers['Origin']
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -23,7 +23,7 @@ feature 'Tracks' do
|
||||
attach_file 'File', File.expand_path('spec/fixtures/test.mp3')
|
||||
click_button 'Upload'
|
||||
|
||||
current_path.should == track_path(Track.find(:first))
|
||||
current_path.should == track_path(Track.first)
|
||||
page.should have_content('Mega song')
|
||||
end
|
||||
|
||||
|
@@ -14,9 +14,8 @@ feature 'API cross origin request' do
|
||||
end
|
||||
|
||||
scenario 'preflight request' do
|
||||
# FIXME: replace with a more stable/generic action
|
||||
# FIXME: request without redirect
|
||||
request_via_redirect(
|
||||
@integration_session.send(
|
||||
:process,
|
||||
:options,
|
||||
api_playlists_path(:format => :json),
|
||||
nil,
|
||||
|
@@ -15,6 +15,8 @@ describe Track do
|
||||
track.file = file
|
||||
end
|
||||
|
||||
it { should be_valid }
|
||||
|
||||
it 'creates a sound for the track' do
|
||||
expect {
|
||||
track.save
|
||||
|
Reference in New Issue
Block a user