Sha256: d33630c2fb2f985a2f1980edb3dcacb103099b8f9c9cef7d63aebddd926e2be9

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

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

2 entries across 2 versions & 1 rubygems

Version Path
active_decorator-0.7.1 test/features/action_view_helpers_test.rb
active_decorator-0.7.0 test/features/action_view_helpers_test.rb