Sha256: d7e8b074180617c54ce54249e2b9e99c8331516e127ad838b5a39ad906ae70ea

Contents?: true

Size: 848 Bytes

Versions: 3

Compression:

Stored size: 848 Bytes

Contents

require 'spec_helper'

describe ZendeskAPI::Group, :delete_after do
  def valid_attributes
    { :name => "My Group" }
  end

  it_should_be_creatable
  it_should_be_updatable :name
  it_should_be_deletable :find => [:deleted?, true]
  it_should_be_readable :groups
  it_should_be_readable :groups, :assignable

  context "with a membership" do
    before(:each) do
      VCR.use_cassette("read_ZendeskAPI::User_groups_create") do
        @object = described_class.create!(client, valid_attributes.merge(default_options))
        @membership = agent.group_memberships.create(:group_id => @object.id, :user_id => agent.id)
      end
    end

    after(:each) do
      VCR.use_cassette("read_ZendeskAPI::User_groups_delete") do
        @object.destroy
        @membership.destroy
      end
    end

    it_should_be_readable agent, :groups
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
zendesk_api-0.1.5 live/group_spec.rb
zendesk_api-0.1.4 live/group_spec.rb
zendesk_api-0.1.3 live/group_spec.rb