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