Sha256: d24349b0fa370de5400fa368a87295eff0ffd368f0f7447c5d2aa7edbe4f46d5

Contents?: true

Size: 1014 Bytes

Versions: 1

Compression:

Stored size: 1014 Bytes

Contents

require 'spec_helper'

feature 'Triggered events' do
  scenario 'User creates a new Post' do
    AppMonit::Config.end_point      = 'http://test.local'
    AppMonit::Config.api_key        = 'api_key'
    AppMonit::Config.env            = 'test'

    10.times do
      visit '/posts/'
      visit '/posts/new'

      fill_in 'Title', :with => 'Title'
      fill_in 'Body', :with => 'Body'
      click_button 'Create Post'

      expect(page).to have_text('Post was successfully created.')

      click_link 'Edit'
      fill_in 'Title', :with => 'Title 2'
      fill_in 'Body', :with => 'Body2'
      click_button 'Update Post'

      expect(page).to have_text('Post was successfully updated.')

      visit '/posts/'
      click_link 'Destroy'

      expect {
        visit '/not_found'
      }.to raise_error

      expect {
        visit '/posts/with_exception'
      }.to raise_error

      @worker = AppMonit::Rails::Worker.instance
    end

    puts AppMonit::Rails::Worker.instance.requests.inspect
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
app_monit_rails-0.0.3 spec/features/trigger_events_spec.rb