Sha256: 3156e78f66a953cf239885ceb7c2359f5248bc54dcc448edd7bb476f3fb32057

Contents?: true

Size: 1.84 KB

Versions: 43

Compression:

Stored size: 1.84 KB

Contents

require 'spec_helper'

feature 'Posting workflows', js: true do

  before(:all) do
    @clean_file = "/tmp/clean_#{Process.pid}.psql"
    save_clean_db(@clean_file)

    populate_test_users

    monkey_patch_new_posting_form
  end

  after(:all) do
    restore_clean_db(@clean_file)
  end

  def monkey_patch_new_posting_form
    # presently, Gemini displays similar monkeypatching behavior.
    # consider coming up with a proper fix...
    Marty::NewPostingForm.has_marty_permissions(BASE: :admin)
  end

  it 'create posting and select it' do
    log_in_as('admin1')

    posting_grid = netzke_find('posting_grid')
    posting_type_combo = netzke_find('Posting Type', 'combobox')

    by 'bring up new posting form' do
      wait_for_ajax
      press('Postings')
      press('New Posting')
    end

    and_by 'make posting TEST-A' do
      posting_type_combo.click
      posting_type_combo.select_values('BASE')
      fill_in('Comment', with: 'TEST-A')
      press('Create')
    end

    and_by 'bring up select posting form' do
      wait_for_ajax
      press('Postings')
      press('Select Posting')
    end

    and_by 'select new posting' do
      within(:gridpanel, 'posting_window', match: :first) do
        wait_for_ajax
        expect(posting_grid.row_count).to eq 2
        posting_grid.select_row(2)
        press('Select')
      end
    end

    and_by 'can see that we are time warped' do
      expect(page).to have_content "TIME WARPED"
    end
  end

  it 'cannot create posting as dev' do
    log_in_as('dev1')

    by 'bring up new posting form' do
      wait_for_ajax
      press('Postings')
      press('New Posting')
    end

    and_by 'no posting available for adding' do
      posting_type_combo = netzke_find('Posting Type', 'combobox')
      posting_type_combo.click
      expect(posting_type_combo.get_values).not_to include 'BASE'
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
marty-2.5.2 spec/features/auth_app_spec.rb
marty-2.5.1 spec/features/auth_app_spec.rb
marty-2.5.0 spec/features/auth_app_spec.rb
marty-2.4.9 spec/features/auth_app_spec.rb
marty-2.4.8 spec/features/auth_app_spec.rb
marty-2.4.7 spec/features/auth_app_spec.rb
marty-2.4.6 spec/features/auth_app_spec.rb
marty-2.4.5 spec/features/auth_app_spec.rb
marty-2.4.4 spec/features/auth_app_spec.rb
marty-2.4.3 spec/features/auth_app_spec.rb
marty-2.4.2 spec/features/auth_app_spec.rb
marty-2.4.1 spec/features/auth_app_spec.rb
marty-2.4.0 spec/features/auth_app_spec.rb
marty-2.3.15 spec/features/auth_app_spec.rb
marty-2.3.14 spec/features/auth_app_spec.rb
marty-2.3.13 spec/features/auth_app_spec.rb
marty-2.3.12 spec/features/auth_app_spec.rb
marty-2.3.11 spec/features/auth_app_spec.rb
marty-2.3.10 spec/features/auth_app_spec.rb
marty-2.3.9 spec/features/auth_app_spec.rb