Sha256: f0d6e0e92d1d8e54738ac2d805dbe98ca5dbc36646a37d5a4961825580215a06
Contents?: true
Size: 886 Bytes
Versions: 1
Compression:
Stored size: 886 Bytes
Contents
require "test_helper" require "bomb_bomb" require "curb" require "minitest/mock" describe "BombBomb API method calls samples" do before do @email = "guille@fivestreet.com" @pw = "12345" @bomb = BombBomb::API.new(@email, @pw) #Fake Response FakeResponse = Struct.new(:body_str) @response = FakeResponse.new("{}") @mock = MiniTest::Mock.new @mock.expect :body_str, @response.body_str end it "checks if login is valid" do Curl.stub(:post, @mock) do @bomb.is_valid_login end assert @mock.verify end it "gets all lists" do Curl.stub(:post, @mock) do @bomb.get_lists end assert @mock.verify end it "gets contacts of a list" do Curl.stub(:post, @mock) do @bomb.get_list_contacts( :list_id => "idtolist") end assert @mock.verify end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bomb_bomb-0.0.2 | test/bomb_bomb_test.rb |