Sha256: 47ae10cd5dbfdc9609c74ec31a863ebc075f40f7cb59c3acd3b7ef440e671f2d

Contents?: true

Size: 487 Bytes

Versions: 3

Compression:

Stored size: 487 Bytes

Contents

require 'spec_helper'

describe RakutenWebService::Resource do
  let(:resource_class) do
    Class.new(RakutenWebService::Resource) do
      set_resource_name 'Dummy'

      attribute :name, :dummySampleAttribute
    end
  end

  describe '#attributes' do
    let(:params) do
      {
        name: 'hoge',
        dummySampleAttribute: 'fuga'
      }
    end

    subject { resource_class.new(params).attributes }

    it { is_expected.to match_array(params.keys.map(&:to_s)) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rakuten_web_service-1.9.1 spec/rakuten_web_service/resource_spec.rb
rakuten_web_service-1.9.0 spec/rakuten_web_service/resource_spec.rb
rakuten_web_service-1.8.0 spec/rakuten_web_service/resource_spec.rb