repository_steps.rb revision 5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13a
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha GraefWhen(/^I create a Repository with name "([^"]+)"$/) do |name|
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef @repository = FactoryGirl.create :repository, name: name
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graefend
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha GraefWhen(/^I upload an ontology with a Theorem$/) do
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef @ontology_prototype = FactoryGirl.build :ontology, repository: @repository
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef @theorem_prototype = FactoryGirl.build :theorem, ontology: @ontology_prototype
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef @ontology = @ontology_prototype.dup
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef @theorem = @theorem_prototype.dup
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef @theorem.ontology = @ontology
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef @ontology.save!
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef @theorem.save!
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graefend
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha GraefWhen(/^I upload the same ontology again$/) do
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef @ontology = @ontology_prototype.dup
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef @ontology.repository = @repository
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef @theorem = @theorem_prototype.dup
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef @theorem.ontology = @ontology
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef @ontology.save!
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef @theorem.save!
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graefend
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha GraefWhen(/^I attempt to prove the Theorem$/) do
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef FactoryGirl.create :proof_attempt, :proven, theorem: @theorem
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graefend
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha GraefWhen(/^I destroy the repository$/) do
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef @repository.destroy
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graefend
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha GraefWhen(/^I visit the proof attempt's loc\/id$/) do
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef visit ProofAttempt.last.locid
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graefend
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha GraefThen(/^a headline should include "Proof Attempt of \[the theorem's name\]"$/) do
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef search_string = "Proof Attempt of #{@theorem.name}"
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graef expect(page.find('h3').text).to include(search_string)
5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13aSascha Graefend