Sha256: baadbf38662d05672e35a4f88fa8b3fcbe284d1753a87126102f9d0694d9c018

Contents?: true

Size: 812 Bytes

Versions: 16

Compression:

Stored size: 812 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'

class ArticlesTest < ActionDispatch::IntegrationTest

  def setup
    login_as_admin!
  end

  test 'list articles' do
    Article.create!(title: "Hello World")

    click_on('Articles')
    assert_equal 200, page.status_code
    assert page.has_text?('Hello World')
  end

  test 'create article' do
    click_on('Articles')
    click_on('New Article')
    assert_equal('/lalala/articles/new', current_path)

    fill_in('Title',                             with: 'My Article')
    attach_file('Image', File.expand_path('../../fixtures/files/image.png', __FILE__))
    click_on('Create Article')
    page.save_page
    assert_equal 200, page.status_code
    assert_equal('/lalala/articles/1', current_path)

    assert page.has_text?('My Article')
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
lalala-4.0.0.dev.202 test/integration/aricles_test.rb
lalala-4.0.0.dev.201 test/integration/aricles_test.rb
lalala-4.0.0.dev.198 test/integration/aricles_test.rb
lalala-4.0.0.dev.195 test/integration/aricles_test.rb
lalala-4.0.0.dev.194 test/integration/aricles_test.rb
lalala-4.0.0.dev.193 test/integration/aricles_test.rb
lalala-4.0.0.dev.192 test/integration/aricles_test.rb
lalala-4.0.0.dev.191 test/integration/aricles_test.rb
lalala-4.0.0.dev.190 test/integration/aricles_test.rb
lalala-4.0.0.dev.189 test/integration/aricles_test.rb
lalala-4.0.0.dev.188 test/integration/aricles_test.rb
lalala-4.0.0.dev.187 test/integration/aricles_test.rb
lalala-4.0.0.dev.186 test/integration/aricles_test.rb
lalala-4.0.0.dev.185 test/integration/aricles_test.rb
lalala-4.0.0.dev.184 test/integration/aricles_test.rb
lalala-4.0.0.dev.183 test/integration/aricles_test.rb