Sha256: 54c50a23f0af26596503b72c6e714caa218694c6fa07c0b5405454bf76ffcc15

Contents?: true

Size: 841 Bytes

Versions: 7

Compression:

Stored size: 841 Bytes

Contents

require 'spec_helper'

describe 'curation_concerns/base/show.json.jbuilder' do
  let(:curation_concern) { create(:generic_work) }

  before do
    allow(curation_concern).to receive(:etag).and_return('W/"87f79d2244ded4239ad1f0e822c8429b1e72b66c"')
    assign(:curation_concern, curation_concern)
    render
  end

  it "renders json of the curation_concern" do
    json = JSON.parse(rendered)
    expect(json['id']).to eq curation_concern.id
    expect(json['title']).to match_array curation_concern.title
    expected_fields = curation_concern.class.fields.select { |f| ![:has_model, :create_date].include? f }
    expected_fields << :date_created
    expected_fields.each do |field_symbol|
      expect(json).to have_key(field_symbol.to_s)
    end
    expect(json['version']).to eq 'W/"87f79d2244ded4239ad1f0e822c8429b1e72b66c"'
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 spec/views/curation_concerns/base/show.json.jbuilder_spec.rb
curation_concerns-1.7.7 spec/views/curation_concerns/base/show.json.jbuilder_spec.rb
curation_concerns-2.0.0 spec/views/curation_concerns/base/show.json.jbuilder_spec.rb
curation_concerns-2.0.0.rc2 spec/views/curation_concerns/base/show.json.jbuilder_spec.rb
curation_concerns-1.7.6 spec/views/curation_concerns/base/show.json.jbuilder_spec.rb
curation_concerns-1.7.5 spec/views/curation_concerns/base/show.json.jbuilder_spec.rb
curation_concerns-1.7.4 spec/views/curation_concerns/base/show.json.jbuilder_spec.rb