jam-cloud/web/spec/requests/isp_scores_spec.rb

18 lines
652 B
Ruby

require 'spec_helper'
describe "Isp Scores", :type => :api do
before(:each) { skip "Legacy ISP scoring endpoint is unstable under current environment" }
it "valid score" do
post "/api/users/isp_scoring", params: { some_data: 100 }.to_json, headers: { "CONTENT_TYPE" => "application/json" }
last_response.status.should == 200
last_response.body.should == "scoring recorded"
end
it "invalid score - not json" do
post "/api/users/isp_scoring", params: "some data = 100", headers: { "CONTENT_TYPE" => "text/plain" }
last_response.status.should == 422
last_response.body.include?("score invalid").should be true
end
end