This repository was archived by the owner on Mar 5, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ def updates_by_profile_id(id, options={})
1919 end
2020
2121 def interactions_by_update_id ( id , options = { } )
22+ check_id ( id )
2223 response = get ( "/updates/#{ id } /interactions.json" , options )
2324 interactions = response [ 'interactions' ] . map { |r | Buff ::Interaction . new ( r ) }
2425 Buff ::Interactions . new (
Original file line number Diff line number Diff line change 6868 end
6969
7070 describe "#set_schedules" do
71- xit "throw error if schedules is empty" do
71+ let ( :id ) { "5160746d54f04a5e3a00000f" }
72+ it "throw error if schedules is empty" do
7273 lambda {
7374 Buff ::Client . new ( "some_token" ) . set_schedules ( id ) } .
7475 should raise_error ( ArgumentError )
Original file line number Diff line number Diff line change 6060 end
6161
6262 describe "#interactions_by_update_id" do
63- xit "requires an id"
64- xit "connects to the correct endpoint"
65- xit "returns an object where total is accessible"
66- it "allows optional params" do
67- url = "https://api.bufferapp.com/1/updates/4ecda476542f7ee521000006/interactions.json?access_token=some_token&page=2"
68- id = "4ecda476542f7ee521000006"
63+ let ( :url ) { "https://api.bufferapp.com/1/updates/4ecda476542f7ee521000006/interactions.json?access_token=some_token&page=2" }
64+ let ( :id ) { "4ecda476542f7ee521000006" }
65+
66+ before do
6967 stub_request ( :get , url ) .
7068 to_return ( fixture ( "interactions_by_update_id.txt" ) )
69+ end
70+
71+ it "requires an id" do
72+ lambda { client . interactions_by_update_id ( page : 2 ) } .
73+ should raise_error ( Buff ::InvalidIdLength )
74+ end
75+
76+ it "allows optional params" do
7177 client . interactions_by_update_id ( id , page : 2 )
7278 end
7379 end
Original file line number Diff line number Diff line change 3535 should eq ( true )
3636 end
3737
38- xit "does not delegate to #handle_response_code when code = 200" do
38+ it "does not delegate to #handle_response_code when code = 200" do
3939 url = "#{ base_path } /info/configuration.json"
4040 fixture_name = "link.txt"
4141 stub_with_to_return ( :get , url , fixture_name )
4242 client . should_not_receive ( :handle_response_code )
4343 client . info
4444 end
4545
46- xit "transforms sample_schedule into correct formatted url" do
47- u = Addressable ::URI . new
48- u . query_values = { schedules : sample_schedules [ 0 ] }
49- u . query . should eq ( post_data )
50- end
5146 end
5247
5348 describe "#handle_response_code" do
You can’t perform that action at this time.
0 commit comments