Sha256: 2b85c7d426105ff0100f0d4bcd5c1a3da0b6a349947a7ca33fbf3f4892bdd07b

Contents?: true

Size: 1.33 KB

Versions: 28

Compression:

Stored size: 1.33 KB

Contents

require 'test_helper'

class User::ArticlesCreatePageTest < IT
  include UserHelpers

  def setup
    super
    sign_in_user 'zbigniew.humeniuk@example.com', 'secret'
  end

  test "should create article" do
    click_on 'New Article'
    try_add_invalid_article
    assert page.has_content? "can't be blank"
    assert page.has_content? "Article contains strong language."
    add_valid_article
    txt = "Article was successfully created."
    assert page.has_selector? "input[type=submit][value='#{txt}']"
  end

  private

    def try_add_invalid_article
      fill_in 'Text', with: 'maaan.. fuck it'
      click_button 'Create Article'
    end

    def add_valid_article
      fill_in 'Title', with: 'Article #1'
      fill_in 'Text', with: "The Ruby I18n (shorthand for internationalization) gem which is shipped with Ruby on Rails (starting from Rails 2.2) provides an easy-to-use and extensible framework for translating your application to a single custom language other than English or for providing multi-language support in your application. The process of 'internationalization' usually means to abstract all strings and other locale specific bits (such as date or currency formats) out of your application. The process of 'localization' means to provide translations and localized formats for these bits."
      click_button 'Create Article'
    end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
loco-rails-3.0.5 test/integration/user/article_create_page_test.rb
loco-rails-3.0.4 test/integration/user/article_create_page_test.rb
loco-rails-3.0.3 test/integration/user/article_create_page_test.rb
loco-rails-2.5.3 test/integration/user/article_create_page_test.rb
loco-rails-2.5.2 test/integration/user/article_create_page_test.rb
loco-rails-3.0.2 test/integration/user/article_create_page_test.rb
loco-rails-3.0.1 test/integration/user/article_create_page_test.rb
loco-rails-2.5.1 test/integration/user/article_create_page_test.rb
loco-rails-2.5.0 test/integration/user/article_create_page_test.rb
loco-rails-2.4.0 test/integration/user/article_create_page_test.rb
loco-rails-2.3.0 test/integration/user/article_create_page_test.rb
loco-rails-3.0.0 test/integration/user/article_create_page_test.rb
loco-rails-2.2.2 test/integration/user/article_create_page_test.rb
loco-rails-2.2.1 test/integration/user/article_create_page_test.rb
loco-rails-2.2.0 test/integration/user/article_create_page_test.rb
loco-rails-2.1.0 test/integration/user/article_create_page_test.rb
loco-rails-2.0.0 test/integration/user/article_create_page_test.rb
loco-rails-1.5.2 test/integration/user/article_create_page_test.rb
loco-rails-1.5.1 test/integration/user/article_create_page_test.rb
loco-rails-1.5.0 test/integration/user/article_create_page_test.rb