Sha256: dea7080f3572a90ae066dbaf7655b1c1e1d36bffdce2f10e5f20710d7cbb2bb5

Contents?: true

Size: 718 Bytes

Versions: 4

Compression:

Stored size: 718 Bytes

Contents

require 'test_helper'

class TestUser < MiniTest::Unit::TestCase
  def setup
    @coop = Coop.new("test@example.com", "password")
    @user = Coop::User.new({ group_id: 12345 })
  end
  
  def test_new_object
    assert_instance_of Coop::User, @user
  end
  
  def test_all
    stub_get("/group/12345/users").with({
      headers: { 'Accept' => 'application/json' }
    }).to_return({
      body: fixture('users.json')
    })
    
    assert_instance_of Array, @user.all
  end
  
  def test_find
    stub_get("/users/12345").with({
      headers: { 'Accept' => 'application/json' }
    }).to_return({
      body: fixture('user.json')
    })
    
    assert_instance_of Coop::APIObject, Coop::User.find(12345)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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