Sha256: 2b5b98943857edc1bed36dc40b3f711339523f87016d659669cec9fa42334127

Contents?: true

Size: 773 Bytes

Versions: 2

Compression:

Stored size: 773 Bytes

Contents

require 'minitest/autorun'
ENV['RACK_ENV'] = 'test'

require '../lib/quickapps_feedback'
require 'sinatra/flash'
module QuickappsFeedback
  class App < Sinatra::Base
    enable :sessions
    register Sinatra::Flash
  end
end
require 'capybara'
require 'capybara/dsl'

describe 'test' do
  include Capybara::DSL

  def setup
    Capybara.app = QuickappsFeedback::App.new
  end

  def test_it_works
    add_headers('X_MXIT_USERID_R' => 'm40228998002')
    visit '/feedback'
    click_link('support')
    fill_in 'feedback_full_message', with: 'I have a support issue for you'
    click_button 'send'
    assert page.has_css?('div.alert-info')
  end

  def add_headers(headers)
    headers.each do |name, value|
      page.driver.browser.header(name, value)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
quickapps_feedback-0.1.1 test/app_test.rb
quickapps_feedback-0.1.0 test/app_test.rb