lib/submodules/ably-ruby/spec/acceptance/rest/channel_spec.rb in ably-rest-0.8.15 vs lib/submodules/ably-ruby/spec/acceptance/rest/channel_spec.rb in ably-rest-0.9.0
- old
+ new
@@ -358,11 +358,14 @@
describe '#history option' do
let(:channel_name) { "persisted:#{random_str(4)}" }
let(:channel) { client.channel(channel_name) }
let(:endpoint) do
- client.endpoint
+ client.endpoint.tap do |client_end_point|
+ client_end_point.user = key_name
+ client_end_point.password = key_secret
+ end
end
let(:default_history_options) do
{
direction: :backwards,
limit: 100
@@ -373,10 +376,9 @@
describe ":#{option}", :webmock do
let!(:history_stub) {
query_params = default_history_options
.merge(option => milliseconds).map { |k, v| "#{k}=#{v}" }.join('&')
stub_request(:get, "#{endpoint}/channels/#{Addressable::URI.encode(channel_name)}/messages?#{query_params}").
- with(basic_auth: [key_name, key_secret]).
to_return(:body => '{}', :headers => { 'Content-Type' => 'application/json' })
}
before do
channel.history(options)