Sha256: 9a4e2bcba67e8ba9eb00ac6dd04b738a49730606f0be186e78a2bebdf841c213

Contents?: true

Size: 809 Bytes

Versions: 1

Compression:

Stored size: 809 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'

class RoomTest < Test::Unit::TestCase
  
  def setup
    @campfire = Tinder::Campfire.new("foobar")
    @room = Tinder::Room.new(@campfire, 1, "Room 1")
  end
  
  def test_toggle_guest_access_rejoins_room
    @response = mock("response")
    @response.expects(:code).returns("200")
    @campfire.expects(:post).with('room/1/toggle_guest_access').returns(@response)
    @campfire.expects(:get).with('room/1').returns(@response)
    @room.toggle_guest_access
  end
  
  def test_guest_access?
    mock_response :guest_access_enabled
    assert @room.guest_access_enabled?
  end
  
private

  def mock_response(response)
    FakeWeb.register_uri('http://foobar.campfirenow.com/room/1',
      :file => "#{FIXTURE_DIR}/pages/room/#{response}.html")
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tinder-0.1.4 test/unit/room_test.rb