Sha256: 8008feb0ee957132c980c5b8d9c04bc13d162777770903389facf48a183c0c23

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

require File.expand_path("../spec_helper", File.dirname(__FILE__))

describe Youroom::MarkUnread do
  let :mark_read do
    Youroom::MarkUnread.new(access_token, [1,2,3])
  end

  describe "#initialize" do
    describe "when can create instance" do
      context "ids are Array class" do
        subject { mark_read }
        it { should be_a(Youroom::MarkUnread) }
        its(:url) { should == Youroom::BASE_URL }
        its(:ids) { should == ["1","2","3"] }
        its(:access_token) { should == access_token }
      end

      context "ids are String instance" do
        subject { Youroom::MarkUnread.new(access_token, "1") }
        its(:ids) { should == ["1"] }
      end

      context "ids are Integer instance" do
        subject { Youroom::MarkUnread.new(access_token, 1) }
        its(:ids) { should == ["1"] }
      end
    end
  end

  context "#path" do
    subject { mark_read }
    its(:path) { should == File.join(mark_read.url, 'unmark_read') }
  end

  context "#params" do
    subject { mark_read }
    its(:params) { should == { :ids => '1,2,3' } }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
youroom_api-0.1.1 spec/youroom_api/unmark_read_spec.rb
youroom_api-0.1.0 spec/youroom_api/unmark_read_spec.rb