ontology_search_steps.rb revision 22f8827cd8892a298f9764ce862db6867307828d
bcb4e51a409d94ae670de96afb8483a4f7855294Stephan BoschWhen(/^I open the ontologies overview page$/) do
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo SirainenThen(/^I should see all available ontologies$/) do
cc935aff970ed6c24d136cc560c7e705a49d536cTimo SirainenGiven(/^the ontology I want to search for$/) do
cc935aff970ed6c24d136cc560c7e705a49d536cTimo Sirainen @ontology = FactoryGirl.create :ontology, name: @name
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen expect(page).not_to have_content("{#@ontology.name}" + 'Foobar')
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo SirainenGiven(/^there is an ontology with a '([^']+)'$/) do |filterable|
7000810786f2959f02cd6d2f4151a9eb61ff5db8Timo Sirainen @filterable = FactoryGirl.create filterable.to_sym
fccd110b494a7e31f23d31d9e3bc3e986c9bb1a8Timo Sirainen @ontology = FactoryGirl.create :ontology, filterable.to_sym => @filterable
cc935aff970ed6c24d136cc560c7e705a49d536cTimo SirainenGiven(/^there is an ontology with '([^']+)'$/) do |filterable|
cc935aff970ed6c24d136cc560c7e705a49d536cTimo Sirainen @filterable = FactoryGirl.create filterable.singularize.to_sym
cc935aff970ed6c24d136cc560c7e705a49d536cTimo Sirainen @ontology = FactoryGirl.create :ontology, filterable.to_sym => [@filterable]
cc935aff970ed6c24d136cc560c7e705a49d536cTimo SirainenWhen(/^I select the '([^']+)' I search for$/) do |filterable|
cc935aff970ed6c24d136cc560c7e705a49d536cTimo Sirainen select @filterable.name, from: "_#{filterable}"
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen select @ontology_type.name, from: '_ontology_type'
cc935aff970ed6c24d136cc560c7e705a49d536cTimo SirainenThen(/^I should see all ontologies with that '[^']+'$/) do
cc935aff970ed6c24d136cc560c7e705a49d536cTimo Sirainen expect(page).to have_content(@ontology.name)
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen expect(page).to have_content(@filterable.name)
cc935aff970ed6c24d136cc560c7e705a49d536cTimo SirainenGiven(/^there is an ontology with all filters given$/) do
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen @ontology_type = FactoryGirl.create :ontology_type
efe78d3ba24fc866af1c79b9223dc0809ba26cadStephan Bosch @project = FactoryGirl.create :project
cc935aff970ed6c24d136cc560c7e705a49d536cTimo Sirainen @formality_level = FactoryGirl.create :formality_level
cc935aff970ed6c24d136cc560c7e705a49d536cTimo Sirainen @license_model = FactoryGirl.create :license_model
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen @ontology = FactoryGirl.create :ontology, ontology_type: @ontology_type,
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen projects: [@project], formality_level: @formality_level,
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen license_models: [@license_model], tasks: [@task]
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo SirainenWhen(/^I select the all filters I search for$/) do
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen select @ontology_type.name, from: '_ontology_type'
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen select @formality_level.name, from: '_formality_level'
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen select @license_model.name, from: '_license_model'
cc935aff970ed6c24d136cc560c7e705a49d536cTimo SirainenThen(/^I should see all ontologies with that features$/) do
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen expect(page).to have_content(@ontology_type.name)
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen expect(page).to have_content(@formality_level.name)
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen expect(page).to have_content(@license_model.name)
92f9871ac981201fe0a47f6c909f790cce14b240Timo SirainenGiven(/^there is an ontology with a type which is in a project$/) do
92f9871ac981201fe0a47f6c909f790cce14b240Timo Sirainen @ontology_type = FactoryGirl.create :ontology_type
92f9871ac981201fe0a47f6c909f790cce14b240Timo Sirainen @ontology = FactoryGirl.create :ontology, ontology_type: @ontology_type,
92f9871ac981201fe0a47f6c909f790cce14b240Timo SirainenWhen(/^I select the type and project I search for$/) do
1270cb6b6139001b0a89f595ad0868b1f3a0af45Timo Sirainen select @ontology_type.name, from: '_ontology_type'
92f9871ac981201fe0a47f6c909f790cce14b240Timo SirainenThen(/^I should see all ontologies with that two features$/) do
1270cb6b6139001b0a89f595ad0868b1f3a0af45Timo Sirainen expect(page).to have_content(@ontology_type.name)
92f9871ac981201fe0a47f6c909f790cce14b240Timo SirainenThen(/^I should see all ontologies with that name$/) do
92f9871ac981201fe0a47f6c909f790cce14b240Timo SirainenGiven(/^there are at least two repositories$/) do
7000810786f2959f02cd6d2f4151a9eb61ff5db8Timo Sirainen @repository_one = FactoryGirl.create :repository, name: 'RepoOne'
7000810786f2959f02cd6d2f4151a9eb61ff5db8Timo Sirainen @repository_two = FactoryGirl.create :repository, name: 'RepoTwo'
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo SirainenGiven(/^there are at least two ontologies$/) do
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen @ontology_one = FactoryGirl.create :ontology, name: 'OntologyOne',
cc23ad7b8ab96d93d5ab5139c431fcdd8d9e1d72Timo Sirainen @ontology_two = FactoryGirl.create :ontology, name: 'OntologyTwo',
1c0020171b04d14adc4966ed963361abc9a86787Timo SirainenWhen(/^I open the repositories overview page$/) do
abb5d20d3155db02a1afec4066d52707ba9d4e52Timo SirainenThen(/^I should see all ontologies in that repository$/) do
abb5d20d3155db02a1afec4066d52707ba9d4e52Timo Sirainen expect(page).to have_content(@ontology_one.name)
abb5d20d3155db02a1afec4066d52707ba9d4e52Timo SirainenThen(/^I should not see ontologies from other repositories$/) do
abb5d20d3155db02a1afec4066d52707ba9d4e52Timo Sirainen expect(page).not_to have_content(@ontology_two.name)
df8046c9a4f6bc2a478ad1e74504d50f3110c906Timo Sirainen expect(page).not_to have_content(@repository_two.name)
df8046c9a4f6bc2a478ad1e74504d50f3110c906Timo SirainenGiven(/^there are at least two ontologies with ontology types$/) do
abb5d20d3155db02a1afec4066d52707ba9d4e52Timo Sirainen @ontology_type = FactoryGirl.create :ontology_type
df8046c9a4f6bc2a478ad1e74504d50f3110c906Timo Sirainen @ontology_one = FactoryGirl.create :ontology, name: 'OntologyOne',
df8046c9a4f6bc2a478ad1e74504d50f3110c906Timo Sirainen repository: @repository_one, ontology_type: @ontology_type
df8046c9a4f6bc2a478ad1e74504d50f3110c906Timo Sirainen @ontology_two = FactoryGirl.create :ontology, name: 'OntologyTwo',
df8046c9a4f6bc2a478ad1e74504d50f3110c906Timo Sirainen repository: @repository_two, ontology_type: @ontology_type
df8046c9a4f6bc2a478ad1e74504d50f3110c906Timo SirainenThen(/^I should see all ontologies in that repository with that type$/) do
df8046c9a4f6bc2a478ad1e74504d50f3110c906Timo Sirainen expect(page).to have_content(@ontology_one.name)
df8046c9a4f6bc2a478ad1e74504d50f3110c906Timo Sirainen expect(page).to have_content(@ontology_type.name)
7000810786f2959f02cd6d2f4151a9eb61ff5db8Timo SirainenThen(/^I should not see ontologies from other repositories with that type$/) do
7000810786f2959f02cd6d2f4151a9eb61ff5db8Timo Sirainen expect(page).not_to have_content(@ontology_two.name)
7000810786f2959f02cd6d2f4151a9eb61ff5db8Timo SirainenGiven(/^there are at least two ontologies with ontology tpyes and projects$/) do
abb5d20d3155db02a1afec4066d52707ba9d4e52Timo Sirainen @ontology_type = FactoryGirl.create :ontology_type
abb5d20d3155db02a1afec4066d52707ba9d4e52Timo Sirainen @ontology_one = FactoryGirl.create :ontology, name: 'OntologyOne',
abb5d20d3155db02a1afec4066d52707ba9d4e52Timo Sirainen repository: @repository_one, ontology_type: @ontology_type, projects:
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen @ontology_two = FactoryGirl.create :ontology, name: 'OntologyTwo',
92f9871ac981201fe0a47f6c909f790cce14b240Timo Sirainen repository: @repository_two, ontology_type: @ontology_type, projects:
7000810786f2959f02cd6d2f4151a9eb61ff5db8Timo SirainenThen(/^I should see all ontologies in that repository with that type, in that project$/) do
7000810786f2959f02cd6d2f4151a9eb61ff5db8Timo Sirainen expect(page).to have_content(@ontology_one.name)
df8046c9a4f6bc2a478ad1e74504d50f3110c906Timo Sirainen expect(page).to have_content(@ontology_type.name)
7000810786f2959f02cd6d2f4151a9eb61ff5db8Timo SirainenThen(/^I should not see ontologies from other repositories with that type, in that project$/) do
7000810786f2959f02cd6d2f4151a9eb61ff5db8Timo Sirainen expect(page).not_to have_content(@ontology_two.name)
7000810786f2959f02cd6d2f4151a9eb61ff5db8Timo SirainenWhen(/^I type in a ontology name I'm searching for which is in the repository$/) do
cc935aff970ed6c24d136cc560c7e705a49d536cTimo SirainenWhen(/^I type in a ontology name I'm searching for which is not existing$/) do
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen expect(page).not_to have_content('OntologyThree')
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo SirainenGiven(/^there is an ontology with a category$/) do
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo SirainenThen(/^I should see all ontologies with a category$/) do
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen expect(page).to have_content(@ont_with_cat.name)
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo SirainenGiven(/^I am logged in as the owner of a private repository$/) do
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen @repo = FactoryGirl.create :private_repository
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo SirainenGiven(/^I am not logged in as the owner of a private repository$/) do
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen @repo = FactoryGirl.create :private_repository
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo SirainenGiven(/^there is an ontology in this repository$/) do
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen @ontology = FactoryGirl.create :ontology, repository: @repo
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo SirainenThen(/^I should see the ontology in this repository$/) do
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo SirainenThen(/^I shouldn't see the ontology in this repository$/) do
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo Sirainen expect(page).not_to have_content(@ontology.name)
d6a7cb184cc882a90aa3d9312082e0029f354ff6Timo SirainenWhen(/^I search for this ontology$/) do