Sha256: c53d84f728b3ad96de732e355e3a2fcf07b85437f2602f8ec48e7abe2c6ed652

Contents?: true

Size: 658 Bytes

Versions: 49

Compression:

Stored size: 658 Bytes

Contents

require 'spec_helper'

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

  before do
    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 eq 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
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
curation_concerns-0.10.0 spec/views/curation_concerns/base/show.json.jbuilder_spec.rb
curation_concerns-0.9.0 spec/views/curation_concerns/base/show.json.jbuilder_spec.rb
curation_concerns-0.8.0 spec/views/curation_concerns/base/show.json.jbuilder_spec.rb
curation_concerns-0.7.0 spec/views/curation_concerns/base/show.json.jbuilder_spec.rb
curation_concerns-0.6.0 spec/views/curation_concerns/base/show.json.jbuilder_spec.rb
curation_concerns-0.5.0 spec/views/curation_concerns/base/show.json.jbuilder_spec.rb
curation_concerns-0.4.0 spec/views/curation_concerns/base/show.json.jbuilder_spec.rb
curation_concerns-0.3.0 spec/views/curation_concerns/base/show.json.jbuilder_spec.rb
curation_concerns-0.2.0 spec/views/curation_concerns/base/show.json.jbuilder_spec.rb