Sha256: b81208cf2ba7d89e2fd818f7fee4f5d31e121a833b1d9ed1b4aa5ab36708f5e0

Contents?: true

Size: 500 Bytes

Versions: 5

Compression:

Stored size: 500 Bytes

Contents

require 'spec_helper'

feature 'decorating partial object in Jbuilder' do
  background do
    Author.create! :name => 'aamine'
    nari = Author.create! :name => 'nari'
    nari.books.create! :title => 'the gc book'
  end
  after do
    Book.delete_all
    Author.delete_all
  end

  scenario 'decorating objects in Jbuilder partials' do
    visit "/authors/#{Author.last.id}.json"
    page.source.should eq '{"name":"nari","books":[{"title":"the gc book","reverse_title":"koob cg eht"}]}'
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
active_decorator-0.5.3 spec/features/jbuilder_spec.rb
active_decorator-0.5.2 spec/features/jbuilder_spec.rb
active_decorator-0.5.1 spec/features/jbuilder_spec.rb
active_decorator-0.5.0 spec/features/jbuilder_spec.rb
active_decorator-0.4.0 spec/features/jbuilder_spec.rb