Sha256: 7bf31ec9d803bcda2c5018811ff6f50981bc37fb831c28366cb9b6dc1f41a2b8

Contents?: true

Size: 1.11 KB

Versions: 4

Compression:

Stored size: 1.11 KB

Contents

# http://blog.crowdint.com/2013/06/14/testing-rails-with-minitest.html

require 'test_helper'

describe "Formie" do
  include Capybara::DSL

  before do
    Order.delete_all
    Order.create :name => 'Rumpelstilzchen'
  end

  it 'should display copyright' do
    visit "/orders"
    assert page.has_content?('Copyright')
  end

  it 'should list one order' do
    order = Order.all.first

    visit "/orders/#{order.id}"
    assert_equal order.name, page.find('form p input#order_name').value
    assert_equal 'Hello Slim', page.find('form span').text
  end

  it 'should remove comments in Slim testing full stack' do
    order = Order.all.first

    visit "/orders/#{order.id}"
    refute page.has_content?("a comment")
  end

  it 'builtins' do
    visit "/orders/new"
    assert page.has_content?("action_name new")
    assert page.has_content?("args [123, 456]")
    assert page.has_content?("block 4")
    assert page.has_content?("controller_name orders")
    assert page.has_content?("form ActionView::Helpers::FormBuilder")
    assert page.has_content?("form.object Order")
    assert page.has_content?("params new")
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
formie-1.0.4 test/integration/order_test.rb
formie-1.0.3 test/integration/order_test.rb
formie-1.0.2 test/integration/order_test.rb
formie-1.0.0 test/integration/order_test.rb