Sha256: c1d29b76c7513f526d1126c5e9f370758ed12b4ce1e478093a0c3cfb282d8d35

Contents?: true

Size: 460 Bytes

Versions: 7

Compression:

Stored size: 460 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'

class JbuilderTest < ActionDispatch::IntegrationTest
  setup do
    Author.create! name: 'aamine'
    nari = Author.create! name: 'nari'
    nari.books.create! title: 'the gc book'
  end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active_decorator-1.3.3 test/features/jbuilder_test.rb
active_decorator-1.3.2 test/features/jbuilder_test.rb
active_decorator-1.3.1 test/features/jbuilder_test.rb
active_decorator-1.3.0 test/features/jbuilder_test.rb
active_decorator-1.2.0 test/features/jbuilder_test.rb
active_decorator-1.1.1 test/features/jbuilder_test.rb
active_decorator-1.1.0 test/features/jbuilder_test.rb