Sha256: f03dd72873514441189b94448b5185bfd5c871f50066b440641ec54ffab15e1d

Contents?: true

Size: 1.09 KB

Versions: 7

Compression:

Stored size: 1.09 KB

Contents

# frozen_string_literal: true

require 'test_helper'

class ActionViewHelpersTest < ActionDispatch::IntegrationTest
  setup do
    aamine = Author.create! name: 'aamine'
    @rhg = aamine.books.create! title: 'RHG'
    @rhg_novel = aamine.books.create! title: 'RHG Novel', type: 'Novel'
  end

  test 'invoking action_view helper methods' do
    visit "/authors/#{@rhg.author.id}/books/#{@rhg.id}"
    within 'a.title' do
      assert page.has_content? 'RHG'
    end
    assert page.has_css?('img')
  end

  test 'invoking action_view helper methods on model subclass' do
    visit "/authors/#{@rhg_novel.author.id}/books/#{@rhg_novel.id}"
    within 'a.title' do
      assert page.has_content? 'RHG Novel'
    end
    assert page.has_css?('img')
  end

  test 'invoking action_view helper methods in rescue_from view' do
    visit "/authors/#{@rhg.author.id}/books/#{@rhg.id}/error"
    assert page.has_content?('ERROR')
  end

  test 'make sure that action_view + action_mailer works' do
    visit "/authors/#{@rhg.author.id}/books/#{@rhg.id}"
    click_link 'purchase'
    assert page.has_content? 'done'
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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