Sha256: 281dd6c93116ed014cdf0018d6b0bd09b0c5dae37a387672aaf4320cd6b8ee29

Contents?: true

Size: 459 Bytes

Versions: 4

Compression:

Stored size: 459 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

4 entries across 4 versions & 2 rubygems

Version Path
lulalala_presenter-0.1.0 test/features/jbuilder_test.rb
active_decorator-1.0.0 test/features/jbuilder_test.rb
active_decorator-0.9.0 test/features/jbuilder_test.rb
active_decorator-0.8.0 test/features/jbuilder_test.rb