Last active
November 6, 2016 20:24
-
-
Save nando/a019804d328a4b6e3fae20e83672f0e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rails_helper" | |
RSpec.describe Api::ExternalServicesController, type: :controller do | |
fixtures :wilson_cms_admin_users, | |
:wilson_cms_roles, | |
:wilson_cms_admin_user_roles | |
let(:metadmin) { wilson_cms_admin_users(:metadmin) } | |
context "GET /api/validate_bin" do | |
it "requires authentication" do | |
get :validate_bin, format: :json | |
expect(response).to be_unauthorized | |
end | |
it "requires the *card_code* param" do | |
authenticate_request(metadmin.email, metadmin.api_pass) | |
get :validate_bin, format: :json | |
expect(response).to be_bad_request | |
end | |
end | |
context "GET /api/check_service_step" do | |
it "requires authentication" do | |
get :check_service_step, format: :json | |
expect(response).to be_unauthorized | |
end | |
it "requires the *message_id* param" do | |
authenticate_request(metadmin.email, metadmin.api_pass) | |
get :check_service_step, format: :json | |
expect(response).to be_bad_request | |
end | |
end | |
context "POST /api/send_offer_mail" do | |
it "requires authentication" do | |
post :send_offer_mail, format: :json | |
expect(response).to be_unauthorized | |
end | |
it "requires the *send_offer_mail* params" do | |
authenticate_request(metadmin.email, metadmin.api_pass) | |
get :send_offer_mail, format: :json | |
expect(response).to be_bad_request | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment