loc_id_routing_steps.rb revision 5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13a
4139N/AGiven(/^my subject is a (.+)$/) do |kind|
4139N/A @subject =
4139N/A case kind
4139N/A when 'SingleOntology'
4139N/A FactoryGirl.create :single_ontology
4139N/A when 'DistributedOntology'
4139N/A FactoryGirl.create :distributed_ontology
4139N/A when 'child Ontology'
4139N/A FactoryGirl.create(:distributed_ontology, :with_children).children.first
4139N/A when 'Symbol'
4139N/A FactoryGirl.create :symbol
4139N/A when 'Mapping'
4139N/A source_ontology = FactoryGirl.create :single_ontology
4139N/A target_ontology = FactoryGirl.create :single_ontology
4139N/A FactoryGirl.create :mapping, source: source_ontology,
4139N/A target: target_ontology
4139N/A when 'Theorem'
4139N/A FactoryGirl.create :theorem
4139N/A when 'ProofAttempt'
4139N/A FactoryGirl.create :proof_attempt
4139N/A when 'ProverOutput'
4139N/A FactoryGirl.create :prover_output
4139N/A end
4139N/Aend
4139N/A
4139N/AGiven(/^I visit my subject's locid$/) do
4139N/A visit @subject.locid
4139N/Aend
4139N/A
4139N/AGiven(/^I visit my subject's (\S+) command$/) do |command|
4139N/A visit locid_for(@subject, command)
4139N/Aend
4139N/A
4139N/AThen(/^the page title should include "(\S+)"$/) do |text|
4139N/A expect(page.title).to include(text)
4139N/Aend
4139N/A
4139N/AThen(/^the page title should include the subject's (\S+)$/) do |attribute|
4139N/A expect(page.title).to include(@subject.send(attribute))
4139N/Aend
4139N/A
4139N/AThen(/^the page title should include the subject's ontology's (\S+)$/) do |attribute|
4139N/A ontology = @subject.ontology
4139N/A expect(page.title).to include(ontology.send(attribute))
4139N/Aend
4139N/A
4139N/AThen(/^the active tab in the navigation level (\d+) should be "([^"]+)"$/) do |level, text|
4139N/A expect(page.find_all(".nav_tab_level#{level} > .nav-tabs > li.active").last.text).
4139N/A to eq(text)
4139N/Aend
4139N/A
4139N/AThen(/^a headline should include "Proof Attempt of \[the corresponding theorem's name\]"$/) do
4139N/A theorem = @subject.theorem
4139N/A search_string = "Proof Attempt of #{theorem.name}"
4139N/A expect(page.find('h3').text).to include(search_string)
4139N/Aend
4139N/A
4139N/AThen(/^a headline should include "Prover Output for \[theorem's name\]'s proof attempt #\[proof attempt's number\]"$/) do
4139N/A proof_attempt = @subject.proof_attempt
4139N/A theorem = proof_attempt.theorem
4139N/A search_string = "Prover Output for #{theorem.name}'s proof attempt ##{proof_attempt.number}"
4139N/A expect(page.find('h3').text).to include(search_string)
end