test/checkins_test.rb in gowalla-0.5.7 vs test/checkins_test.rb in gowalla-0.5.8

- old
+ new

@@ -1,18 +1,28 @@ require 'helper' class CheckinsTest < Test::Unit::TestCase - context "When using the Gowalla API and working with checkins" do - setup do - @client = gowalla_test_client - end + should "fetch info for a checkin" do + client = gowalla_basic_client - should "fetch info for a checkin" do - stub_get("https://pengwynn:0U812@api.gowalla.com/checkins/88", "checkin.json") - checkin = @client.checkin_info(88) - checkin.spot.name.should == 'Movie Tavern' - checkin.message.should == 'There sending us Back-- to the Future!' - end + stub_request("https://pengwynn:0U812@api.gowalla.com/checkins/88", "checkin_info.json") + checkin = client.checkin_info(88) + checkin.spot.name.should == 'Movie Tavern' + checkin.message.should == 'There sending us Back-- to the Future!' + end + + should "create a checkin" do + client = gowalla_oauth_client + + stub_request("https://api.gowalla.com/checkins?oauth_token=0U812", "checkin.json") + checkin = client.checkin \ + :spot_id => 18568, + :lat => 33.237593417, + :lng => -96.960559033, + :comment => 'visiting', + :post_to_facebook => 0, + :post_to_twitter => 0 + checkin.message.should == 'coffee test' end end