Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jkodumal committed Jan 26, 2016
1 parent 94b8307 commit 39cf927
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spec/ldclient_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@
end
end

describe '#get_features' do
describe '#all_flags' do
it "will parse and return the features list" do
result = double("Faraday::Response", status: 200, body: '{"items": ["asdf"]}')
expect(client).to receive(:make_request).with("/api/features").and_return(result)
data = client.send(:get_features)
expect(data).to eq ["asdf"]
result = double("Faraday::Response", status: 200, body: '{"foo": {"key": "foo"}}')
expect(client).to receive(:make_request).with("/api/eval/features").and_return(result)
data = client.send(:all_flags)
expect(data).to eq {foo : {key: "foo"}}
end
it "will log errors" do
result = double("Faraday::Response", status: 418)
expect(client).to receive(:make_request).with("/api/features").and_return(result)
expect(client).to receive(:make_request).with("/api/eval/features").and_return(result)
expect(client.instance_variable_get(:@config).logger).to receive(:error)
client.send(:get_features)
client.send(:all_flags)
end
end

Expand Down

0 comments on commit 39cf927

Please sign in to comment.