Skip to content

Commit ab06daa

Browse files
committed
Add test for app_access_token
1 parent b26eeb1 commit ab06daa

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/funky/connections/base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def self.json_for(uri, max_retries = 3)
5252

5353
def self.uri_with_query(uri, query={})
5454
return nil if uri.nil?
55-
new_query = URI.decode_www_form(uri.query).to_h.merge(query)
55+
new_query = URI.decode_www_form(uri.query).to_h.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}.merge(query)
5656
uri.query = URI.encode_www_form(new_query)
5757
uri
5858
end

spec/pages/find_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,17 @@
3636

3737
it { expect { page }.to raise_error(Funky::ContentNotFound) }
3838
end
39+
40+
context 'with invalid app access token' do
41+
before { Funky::Connection::API.instance_variable_set :@app_access_token, 'invalid-token' }
42+
43+
context 'given an existing page ID' do
44+
let(:page_id) { fullscreen_page_id }
45+
46+
specify 'does not raise error by refreshing' do
47+
expect{ page }.not_to raise_error
48+
end
49+
end
50+
end
3951
end
4052
end

0 commit comments

Comments
 (0)