Skip to content

Commit

Permalink
Fix: DEPRECATION WARNING
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldoaraujo authored and Louis committed Oct 25, 2018
1 parent b8bf804 commit 3e0464e
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 26 deletions.
4 changes: 2 additions & 2 deletions spec/api/management_api_v1/accounts_spec.rb
Expand Up @@ -194,7 +194,7 @@
let(:params) do
{
email: email,
password_hash: password_hash,
password_hash: password_hash
}.merge(profile_params)
end

Expand Down Expand Up @@ -251,7 +251,7 @@
it 'renders an error' do
expect { do_request }.to_not change { Profile.count }
expect_status_to_eq 422
expect(json_body[:error]).to eq ["Country must have alpha2 or alpha3 format"]
expect(json_body[:error]).to eq ['Country must have alpha2 or alpha3 format']
end
end
end
Expand Down
Expand Up @@ -14,12 +14,12 @@

it 'works in standard conditions' do
post_json '/management_api/v1/timestamp', multisig_jwt_management_api_v1({}, :alex)
expect(response).to be_success
expect(response).to be_successful
end

it 'allows GET and doesn\'t require authentication for documentation' do
get '/management_api/v1/swagger_doc'
expect(response).to be_success
expect(response).to be_successful
end

it 'allows only POST, PUT' do
Expand Down Expand Up @@ -66,7 +66,7 @@
before { config[:jwt].merge!(iss: 'qux') }
it 'validates issuer' do
post_json '/management_api/v1/timestamp', multisig_jwt_management_api_v1({ iss: 'qux' }, :alex)
expect(response).to be_success
expect(response).to be_successful
end
end

Expand All @@ -85,7 +85,7 @@
before { config[:jwt].merge!(aud: 'qux') }
it 'validates audience' do
post_json '/management_api/v1/timestamp', multisig_jwt_management_api_v1({ aud: 'qux' }, :alex)
expect(response).to be_success
expect(response).to be_successful
end
end

Expand Down
12 changes: 6 additions & 6 deletions spec/api/user_api/v1/cors_spec.rb
Expand Up @@ -15,7 +15,7 @@
ENV['API_CORS_ORIGINS'] = nil

get '/api/v1/accounts/me', headers: auth_header.merge(origin_header)
expect(response).to be_success
expect(response).to be_successful

expect(response.headers['Access-Control-Allow-Origin']).to eq(nil)
expect(response.headers['Access-Control-Allow-Credentials']).to eq(nil)
Expand All @@ -28,7 +28,7 @@
ENV['API_CORS_ALLOW_INSECURE_ORIGINS'] = 'true'

get '/api/v1/accounts/me', headers: auth_header.merge(origin_header)
expect(response).to be_success
expect(response).to be_successful

expect(response.headers['Access-Control-Allow-Origin']).to eq(ranger_url)
expect(response.headers['Access-Control-Allow-Credentials']).to eq('false')
Expand All @@ -46,7 +46,7 @@
it 'does not set CORS headers with OPTIONS' do
reset! unless integration_session
integration_session.send :process, 'OPTIONS', '/api/v1/accounts/me', headers: origin_header
expect(response).to be_success
expect(response).to be_successful

expect(response.headers['Access-Control-Allow-Origin']).to eq(nil)
expect(response.headers['Access-Control-Allow-Credentials']).to eq(nil)
Expand All @@ -56,7 +56,7 @@

it 'does not set CORS headers with GET' do
get '/api/v1/accounts/me', headers: auth_header.merge(origin_header)
expect(response).to be_success
expect(response).to be_successful
expect(response.headers['Access-Control-Allow-Origin']).to eq(nil)
expect(response.headers['Access-Control-Allow-Credentials']).to eq(nil)
expect(response.headers['Access-Control-Allow-Methods']).to eq(nil)
Expand All @@ -78,7 +78,7 @@
it 'sends CORS headers when requesting using OPTIONS' do
reset! unless integration_session
integration_session.send :process, 'OPTIONS', '/api/v1/accounts/me', headers: origin_header
expect(response).to be_success
expect(response).to be_successful
expect(response.headers['Access-Control-Allow-Origin']).to eq(ranger_url)
expect(response.headers['Access-Control-Allow-Credentials']).to eq('true')
expect(response.headers['Access-Control-Allow-Methods']).to eq('GET, POST, PUT, PATCH, DELETE')
Expand All @@ -87,7 +87,7 @@

it 'sends CORS headers when requesting using GET' do
get '/api/v1/accounts/me', headers: auth_header.merge(origin_header)
expect(response).to be_success
expect(response).to be_successful
expect(response.headers['Access-Control-Allow-Origin']).to eq(ranger_url)
expect(response.headers['Access-Control-Allow-Credentials']).to eq('true')
expect(response.headers['Access-Control-Allow-Methods']).to eq('GET, POST, PUT, PATCH, DELETE')
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/admin/accounts_controller_spec.rb
Expand Up @@ -10,7 +10,7 @@
describe 'GET #index' do
it 'returns a success response' do
get :index, params: {}
expect(response).to be_success
expect(response).to be_successful
expect(assigns(:accounts).count).to eq 1
end
end
Expand All @@ -32,7 +32,7 @@

it 'returns a success response' do
do_request
expect(response).to be_success
expect(response).to be_successful
expect(assigns(:account)).to eq account
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/controllers/admin/websites_controller_spec.rb
Expand Up @@ -18,7 +18,7 @@

it 'returns a success response' do
get :index, params: {}
expect(response).to be_success
expect(response).to be_successful
end
end

Expand All @@ -27,14 +27,14 @@

it 'returns a success response' do
get :show, params: { id: website.to_param }
expect(response).to be_success
expect(response).to be_successful
end
end

describe 'GET #new' do
it 'returns a success response' do
get :new, params: {}
expect(response).to be_success
expect(response).to be_successful
end
end

Expand All @@ -43,7 +43,7 @@

it 'returns a success response' do
get :edit, params: { id: website.to_param }
expect(response).to be_success
expect(response).to be_successful
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/documents_controller_spec.rb
Expand Up @@ -36,7 +36,7 @@

it 'returns a success response' do
get :new, params: {}
expect(response).to be_success
expect(response).to be_successful
end
end

Expand Down Expand Up @@ -68,7 +68,7 @@
it "returns a success response (i.e. to display the 'new' template)" do
post :create, params: { document: invalid_attributes }
expect(flash[:alert]).to eq('Some fields are empty or invalid')
expect(response).to be_success
expect(response).to be_successful
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/phones_controller_spec.rb
Expand Up @@ -24,7 +24,7 @@
context 'when account level is passed' do
it 'returns a success response' do
do_request
expect(response).to be_success
expect(response).to be_successful
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/profiles_controller_spec.rb
Expand Up @@ -52,7 +52,7 @@
context 'when account has no profile' do
it 'returns a success response' do
get :new, params: {}
expect(response).to be_success
expect(response).to be_successful
end
end
end
Expand Down Expand Up @@ -93,7 +93,7 @@
context 'with invalid params' do
it "returns a success response (i.e. to display the 'new' template)" do
post :create, params: { profile: invalid_attributes }
expect(response).to be_success
expect(response).to be_successful
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/sessions_controller_spec.rb
Expand Up @@ -15,7 +15,7 @@

it 'renders confirm template' do
do_request
expect(response).to be_success
expect(response).to be_successful
expect(assigns(:otp_enabled)).to eq false
expect(response).to render_template(:confirm)
end
Expand All @@ -24,7 +24,7 @@
context 'when otp is enabled' do
it 'renders confirm template' do
do_request
expect(response).to be_success
expect(response).to be_successful
expect(assigns(:otp_enabled)).to eq true
expect(response).to render_template(:confirm)
end
Expand Down
1 change: 0 additions & 1 deletion spec/views/documents/new.html.erb_spec.rb
Expand Up @@ -15,7 +15,6 @@
end

it 'renders new document form' do
skip
render

assert_select 'form[action=?][method=?]', documents_path, 'post' do
Expand Down

0 comments on commit 3e0464e

Please sign in to comment.