spec/unit/container/operation_spec.rb in evil-client-3.0.2 vs spec/unit/container/operation_spec.rb in evil-client-3.0.3

- old
+ new

@@ -10,24 +10,24 @@ let(:operation) { described_class.new schema, nil, opts } let(:connection) { Evil::Client::Connection } let(:schema) do double :schema, - to_s: "MyApi.users.update", - client: double(:client, connection: connection), - parent: nil, + to_s: "MyApi.users.update", + client: double(:client, connection: connection), + parent: nil, settings: settings_klass, definitions: { - path: -> { "https://example.com/users/#{id}" }, + path: -> { "https://example.com/users/#{id}" }, http_method: -> { "PATCH" }, - format: -> { :json }, - security: -> { { headers: { "Authentication" => token } } }, - headers: -> { { "Content-Language" => language } }, - query: -> { { language: language } }, - body: -> { { name: name } }, - middleware: -> { Test::Middleware }, - responses: { 200 => proc { |_, _, body| JSON.parse body.first } } + format: -> { :json }, + security: -> { { headers: { "Authentication" => token } } }, + headers: -> { { "Content-Language" => language } }, + query: -> { { language: language } }, + body: -> { { name: name } }, + middleware: -> { Test::Middleware }, + responses: { 200 => proc { |_, _, body| JSON.parse body.first } } } end let(:settings_klass) do Class.new(Evil::Client::Settings) do @@ -52,12 +52,12 @@ subject { operation.call } let(:request) do a_request(:patch, "https://example.com/users/7?language=en_US") do |r| expect(r.body).to eq '{"name":"Joe"}' - expect(r.headers).to include "Authentication" => "qux", + expect(r.headers).to include "Authentication" => "qux", "Content-Language" => "en_US", - "Accept-Language" => "ru_RU" + "Accept-Language" => "ru_RU" end end it "sends resolved request" do subject