Sha256: d7a37dc52f100b3cf832c6be63c6b7e4c049bfcae942204f71ba9ea275ee6d86
Contents?: true
Size: 909 Bytes
Versions: 3
Compression:
Stored size: 909 Bytes
Contents
require 'spec_helper' describe 'Metadata', type: :feature do describe '/metadata.json' do before do # 実行順により base_spec で作られた Classオブジェクトが返って来て意図通りのテストにならないため allow(TogoStanza::Stanza).to receive(:all).and_return([BarStanza, FooStanza]) visit '/metadata.json' end it 'should return metadata as JSON' do json = JSON.parse(page.body) json["stanza:stanzas"].class.should eq(Array) json["stanza:stanzas"].first.should include('stanza:label' => 'Foo Stanza') end end describe '/:id/metadata.json' do before do visit '/foo/metadata.json' end it 'should return metadata as JSON' do json = JSON.parse(page.body) json.should include('stanza:label' => 'Foo Stanza') json.should include('@id' => "http://www.example.com/foo") end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
togostanza-2.2.2 | spec/features/metadata_spec.rb |
togostanza-2.2.1 | spec/features/metadata_spec.rb |
togostanza-2.2.0 | spec/features/metadata_spec.rb |