Skip to content

Commit

Permalink
test: update base resource spec
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Oct 1, 2020
1 parent d39533c commit 7af34ea
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions spec/lib/pact_broker/api/resources/default_base_resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Resources
let(:uri) { URI('http://example.org/path?query') }
let(:body) { double('body', to_s: body_string) }
let(:body_string) { '' }
let(:env) { double('env') }
let(:env) { double('env').as_null_object }

subject { BaseResource.new(request, response) }

Expand Down Expand Up @@ -100,14 +100,19 @@ module Resources
end

describe "decorator_options" do
before do
allow(env).to receive(:[]).with("QUERY_STRING").and_return("foo=bar")
end

context "with no overrides" do
it "returns the default decorator options" do
expect(subject.decorator_options).to eq(
user_options: {
base_url: "http://example.org",
resource_url: "http://example.org/path",
env: env,
resource_title: nil
resource_title: nil,
query_string: "foo=bar"
}
)
end
Expand All @@ -121,7 +126,8 @@ module Resources
resource_url: "http://example.org/path",
env: env,
resource_title: "foo",
something: "else"
something: "else",
query_string: "foo=bar"
}
)
end
Expand Down

0 comments on commit 7af34ea

Please sign in to comment.