Sha256: 39c3d1bed2c94b910268115e8c73748be03b4b52dd30ceea8990ec7120d084a4

Contents?: true

Size: 1.41 KB

Versions: 5

Compression:

Stored size: 1.41 KB

Contents

require 'test_helper'

class ShowEditDeleteLinkHelperTest < ActionView::TestCase
  include Wobapphelpers::Helpers::All

  setup do
    @post = Post.create(subject: 'bla', body: 'text')
  end

  test "new_link with options :class, :title and :remote" do
    render plain: new_link(Post, class: 'btn btn-small', 
                            title: 'Test title', remote: true)

    assert_select 'a[class=?][title=?][data-remote=?]', 
                  "btn btn-small", "Test title", "true"
  end

  test "show_link with options :class, :title and :remote" do
    render plain: show_link(@post, class: 'btn btn-small', 
                            title: 'Test title', remote: true)

    assert_select 'a[class=?][title=?][data-remote=?]', 
                  "btn btn-small", "Test title", "true"
  end

  test "edit_link with options :class, :title and :remote" do
    render plain: edit_link(@post, class: 'btn btn-small', 
                            title: 'Test title', remote: true)

    assert_select 'a[class=?][title=?][data-remote=?]', 
                  "btn btn-small", "Test title", "true"
  end

  test "delete_link with options :class, :title and :remote" do
    render plain: delete_link(@post, class: 'btn btn-small', 
                            title: 'Test title', remote: true)

    assert_select 'a[class=?][title=?][data-remote=?][data-method=?]', 
                  "btn btn-small", "Test title", "true", "delete"
  end



end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
wobapphelpers-4.2.0 test/helpers/show_edit_delete_link_helper_test.rb
wobapphelpers-4.1.2 test/helpers/show_edit_delete_link_helper_test.rb
wobapphelpers-4.1.1 test/helpers/show_edit_delete_link_helper_test.rb
wobapphelpers-4.1.0 test/helpers/show_edit_delete_link_helper_test.rb
wobapphelpers-4.0.0 test/helpers/show_edit_delete_link_helper_test.rb