Sha256: 4ec12390f6dad4ac2ee0821d74ff9f6d910b7944d08cfe81b51da92f0eec1a7c

Contents?: true

Size: 917 Bytes

Versions: 14

Compression:

Stored size: 917 Bytes

Contents

require 'helper'

describe Desk::Client do
  context "System Message" do

    let(:endpoint) { "system_message" }
    let(:id) { nil }
    let(:check_key) { "updated_at" }
    let(:check_value) { "2013-11-22T22:49:20Z" }

    include_context "basic configuration"

    context "the current message" do

      include_context "plural endpoint"

      subject { client.send("show_#{endpoint}") }

      before do
        stub_get("#{endpoint}").to_return(:body => fixture(endpoint))
      end

      it "gets the correct resource" do
        subject
        expect(a_get("#{endpoint}")).to have_been_made
      end

      it { expect(subject).to be_a Hashie::Deash }

      it "has a valid entry" do
        expect(subject.id).to eq(id)
        expect(subject.send(check_key)).to eq(check_value)
      end

      it "allows raw access" do
        expect(subject.raw).to be_a Hashie::Deash
      end

    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
desk-1.2.0 spec/desk/client/system_message_spec.rb
desk-1.1.1 spec/desk/client/system_message_spec.rb
desk-1.1.0 spec/desk/client/system_message_spec.rb
desk-1.0.10 spec/desk/client/system_message_spec.rb
desk-1.0.9 spec/desk/client/system_message_spec.rb
desk-1.0.8 spec/desk/client/system_message_spec.rb
desk-1.0.7 spec/desk/client/system_message_spec.rb
desk-1.0.6 spec/desk/client/system_message_spec.rb
desk-1.0.5 spec/desk/client/system_message_spec.rb
desk-1.0.4 spec/desk/client/system_message_spec.rb
desk-1.0.3 spec/desk/client/system_message_spec.rb
desk-1.0.2 spec/desk/client/system_message_spec.rb
desk-1.0.1 spec/desk/client/system_message_spec.rb
desk-1.0.0 spec/desk/client/system_message_spec.rb