Sha256: 3c724667fec8ebf3f3beef0efb32579874caec1c873a69b48b423b8bd97a65f9

Contents?: true

Size: 1.16 KB

Versions: 16

Compression:

Stored size: 1.16 KB

Contents

require 'test_helper'

class FeedbackSubmissionTest < ActionDispatch::IntegrationTest
  fixtures :all

  describe "submitting feedback" do
    before do
      visit "/pointless_feedback"

      fill_in_fields

      click_on "Submit"
    end

    test "redirects to the root path" do
      assert_equal current_path, "/"
    end

    test "thanks message is displayed" do
      within('body') do
        assert_match 'Thanks for your feedback!', text
      end
    end
  end

  describe "submitting feedback with the honeypot field filled in" do
    before do
      visit "/pointless_feedback"

      fill_in_fields
      fill_in "message_contact_info", :with => "I'm a spam bot!"

      click_on "Submit"
    end

    test "redirects to the root path" do
      assert_equal current_path, "/"
    end

    test "thanks message is displayed" do
      within('body') do
        assert_match 'Thanks for your feedback!', text
      end
    end
  end

  def fill_in_fields
    fill_in "Name",          :with => "Eli"
    fill_in "Email address", :with => "eli@example.com"
    select "Other",          :from => "Topic"
    fill_in "Description",   :with => "This site is awful"
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
pointless_feedback-4.1.3 test/integration/pointless_feedback/feedback_submission_test.rb
pointless_feedback-4.1.2 test/integration/pointless_feedback/feedback_submission_test.rb
pointless_feedback-4.1.1 test/integration/pointless_feedback/feedback_submission_test.rb
pointless_feedback-4.1.0 test/integration/pointless_feedback/feedback_submission_test.rb
pointless_feedback-4.0.6 test/integration/pointless_feedback/feedback_submission_test.rb
pointless_feedback-4.0.5 test/integration/pointless_feedback/feedback_submission_test.rb
pointless_feedback-4.0.3 test/integration/pointless_feedback/feedback_submission_test.rb
pointless_feedback-4.0.2 test/integration/pointless_feedback/feedback_submission_test.rb
pointless_feedback-3.0.2 test/integration/pointless_feedback/feedback_submission_test.rb
pointless_feedback-4.0.1 test/integration/pointless_feedback/feedback_submission_test.rb
pointless_feedback-3.0.0 test/integration/pointless_feedback/feedback_submission_test.rb
pointless_feedback-4.0.0 test/integration/pointless_feedback/feedback_submission_test.rb
pointless_feedback-1.0.3 test/integration/pointless_feedback/feedback_submission_test.rb
pointless_feedback-1.0.2 test/integration/pointless_feedback/feedback_submission_test.rb
pointless_feedback-1.0.1 test/integration/pointless_feedback/feedback_submission_test.rb
pointless_feedback-1.0.0 test/integration/pointless_feedback/feedback_submission_test.rb