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