Sha256: e0e2004be342a09699b8fd979aa315cee6ef8a82fd7bdc772da571608157caea

Contents?: true

Size: 1.03 KB

Versions: 3

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

def non_existent_locator
  {:title => /I don't exist/}
end

class NonExistentScreen
  include Mohawk
  window non_existent_locator
end

describe Mohawk::Navigation do
  context '#on with extra info' do
    When { start_app }
    Then { on(MainForm, pid: Mohawk.app.pid).present? }
  end

  context '#navigate_to' do
    Given do
      Mohawk::Navigation.routes = {
          :default => [
              [MainForm, :about],
              [About, :close],
              [MainForm, :data_entry_form],
              [DataEntryForm]
          ]
      }
      start_app
    end

    When(:data_entry_form) { navigate_to(DataEntryForm) }
    Then { expect(data_entry_form).to be_present }
  end

  context 'name the screen that could not be found' do
    When { Mohawk.timeout = 1 }
    Then do
      screen_class = NonExistentScreen
      expect { on(screen_class) }.to raise_error Mohawk::Waiter::WaitTimeout, "Unable to locate #{screen_class} using #{non_existent_locator}"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mohawk-1.0 spec/lib/mohawk/navigation_spec.rb
mohawk-0.4.4 spec/lib/mohawk/navigation_spec.rb
mohawk-0.4.3 spec/lib/mohawk/navigation_spec.rb