Sha256: 56898533d498b7f650a88697ad1ebb4033dadb6a0a12e3f075b172518f101051

Contents?: true

Size: 1.07 KB

Versions: 18

Compression:

Stored size: 1.07 KB

Contents

require 'test_helper'

class Admin::ReviewArticleTest < IT
  include Loco::Emitter
  include AdminHelpers

  def setup
    super
    sign_in
    click_on "Articles"
    click_on "Review"
  end

  test "should auto update an article" do
    update_article articles(:one)
    assert page.has_content? "AGtTRA"
    assert page.has_content? "TESTING_SUPPORT..." * 6
  end

  test "should update an article" do
    submit_review
    visit "admin/articles/#{articles(:one).id}/edit"
    assert_not page.evaluate_script("$('#article_published').is(':checked')")
    assert_equal 'Damn good article', find(:css, 'textarea').value
    assert_equal '5', page.evaluate_script(%{$('input[name="article[admin_rate]"]:checked').val()})
    assert_equal 'Health', page.evaluate_script(%{$('select option:selected').text()})
    assert articles(:one).reload.admin_review_time > 0
  end

  private

    def submit_review
      uncheck "Published"
      fill_in 'Short review', with: 'Damn good article'
      choose "Amazing"
      select 'Health', from: 'Category'
      click_button 'Update Article'
    end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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