Sha256: cf5a35282f0ed488476a7587165c7d0ea447b6f86aff25783673570cbf7a8981

Contents?: true

Size: 1.03 KB

Versions: 9

Compression:

Stored size: 1.03 KB

Contents

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

describe Youroom::MyGroup do
  describe "#path" do
    describe "when url is original" do
      before do
        @client = Youroom::MyGroup.new(access_token)
      end

      subject { @client.path }
      it { should == File.join(Youroom::BASE_URL, 'groups', 'my?format=json') }
    end

    describe "when url is not original" do
      before do
        @client = Youroom::MyGroup.new(access_token, WW_URL)
      end

      subject { @client.path }
      it { should == File.join(WW_URL, 'groups', 'my?format=json') }
    end
  end

  describe "#call" do
    before do
      @client = Youroom::MyGroup.new(access_token, WW_URL)

      # NOTICE: WW not check params
      WW::Server.mock(:youroom, { :format => "json"} ).get("/youroom/groups/my") do
        { :entry => "hogehoge" }.to_json
      end
    end

    after do
      WW::Server.verify(:youroom)
    end

    subject { @client.get }
    it "should call request url" do
      should be_a_instance_of(Hash)
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
youroom_api-0.1.4 spec/youroom_api/my_group_spec.rb
youroom_api-0.1.3 spec/youroom_api/my_group_spec.rb
youroom_api-0.1.2 spec/youroom_api/my_group_spec.rb
youroom_api-0.1.1 spec/youroom_api/my_group_spec.rb
youroom_api-0.1.0 spec/youroom_api/my_group_spec.rb
youroom_api-0.0.13 spec/youroom_api/my_group_spec.rb
youroom_api-0.0.12 spec/youroom_api/my_group_spec.rb
youroom_api-0.0.11 spec/youroom_api/my_group_spec.rb
youroom_api-0.0.10 spec/youroom_api/my_group_spec.rb