Sha256: 9922bade4b5b3d16a5684ee97797661f4b889ffb4a8720fbf2262a865e45044b

Contents?: true

Size: 1.12 KB

Versions: 6

Compression:

Stored size: 1.12 KB

Contents

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

describe Youroom::Picture do
  describe "#initialize" do
    context "when can not create instanse" do
      before do
        @error_data1 = ["hoge", nil]
        @error_data2 = [nil, "hoge"]
      end

      it do
        lambda { Youroom::Picture.new(*@error_data1) }.should raise_exception(ArgumentError)
      end

      it do
        lambda { Youroom::Picture.new(*@error_data2) }.should raise_exception(ArgumentError)
      end

    end

    context "when can create user instance" do
      subject { Youroom::Picture.new(access_token, "room_id", "participation_id") }
      it { should be_a(Youroom::Picture) }
      its(:url) { should == Youroom::BASE_URL }
      its(:room_id) { should == "room_id" }
      its(:participation_id) { should == "participation_id" }
    end
  end

  describe "#path" do
    before do
      @picture = Youroom::Picture.new(access_token, "room_id", "participation_id", WW_URL)
    end

    subject { @picture.path }
    it { should == File.join(WW_URL, 'r', 'room_id', 'participations', 'participation_id', 'picture.image') }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
youroom_api-0.1.3 spec/youroom_api/picture_spec.rb
youroom_api-0.1.2 spec/youroom_api/picture_spec.rb
youroom_api-0.1.1 spec/youroom_api/picture_spec.rb
youroom_api-0.1.0 spec/youroom_api/picture_spec.rb
youroom_api-0.0.13 spec/youroom_api/picture_spec.rb
youroom_api-0.0.12 spec/youroom_api/picture_spec.rb