Sha256: 2ef5b8aa4227623e4b600521c5b0c3c637d388415f65b6dd388007faf14a24d5
Contents?: true
Size: 921 Bytes
Versions: 26
Compression:
Stored size: 921 Bytes
Contents
require "spec_helper" require "lol" include Lol describe ChampionStatisticsSummary do it_behaves_like 'Lol model' do let(:valid_attributes) { { id: 1 } } end %w(id name).each do |attribute| describe "#{attribute} attribute" do it_behaves_like 'plain attribute' do let(:attribute) { attribute } let(:attribute_value) { 'asd' } end end end describe 'stats attribute' do it_behaves_like 'plain attribute' do let(:attribute) { 'stats' } let(:attribute_value) { 'asd' } end context 'when it is passed as an hash' do subject { ChampionStatisticsSummary.new stats: { 'FooBar' => 'baz' } } it 'will convert the hash in an openstruct object' do expect(subject.stats).to be_a OpenStruct end it 'will convert each hash key in underscore' do expect(subject.stats.foo_bar).to eq 'baz' end end end end
Version data entries
26 entries across 26 versions & 1 rubygems