Sha256: eca54a05cd8aaf6b2cd4a4173e3e0475bb2328e00fbcbe728f27ca8b575dfcc0

Contents?: true

Size: 997 Bytes

Versions: 4

Compression:

Stored size: 997 Bytes

Contents

require 'test_helper'

class TestAgenda < MiniTest::Unit::TestCase
  def setup
    @coop = Coop.new("test@example.com", "password")
    @agenda = Coop::Agenda.new({ group_id: 12345 })
  end
  
  def test_new_object
    assert_instance_of Coop::Agenda, @agenda
  end
  
  def test_global
    stub_get("/groups/12345/agenda").with({
      headers: { 'Accept' => 'application/json' }
    }).to_return({
      body: fixture('agenda.json')
    })
    
    assert_instance_of Coop::APIObject, @agenda.global
  end
  
  def test_users
    stub_get("/groups/12345/user_agendas").with({
      headers: { 'Accept' => 'application/json' }
    }).to_return({
      body: fixture('user_agendas.json')
    })
    
    assert_instance_of Array, @agenda.users
  end
  
  def test_user
    stub_get("/groups/12345/my_agenda").with({
      headers: { 'Accept' => 'application/json' }
    }).to_return({
      body: fixture('my_agenda.json')
    })
    
    assert_instance_of Coop::APIObject, @agenda.user
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
coop-1.1.1 test/coop/api_object/test_agenda.rb
coop-1.1.0 test/coop/api_object/test_agenda.rb
coop-1.0.1 test/coop/api_object/test_agenda.rb
coop-1.0.0 test/coop/api_object/test_agenda.rb