ontology_search_steps.rb revision 518acf1845fb61410df491c389966b89e1b9a071
409N/AGiven(/^there is an ontology$/) do
3N/A @ontology = FactoryGirl.create :ontology
3N/Aend
3N/A
3N/AWhen(/^I open the ontologies overview page$/) do
3N/A visit ontologies_path
3N/Aend
3N/A
3N/AThen(/^I should see all available ontologies$/) do
3N/A page.should have_content(@ontology.name)
3N/Aend
3N/A
3N/AGiven(/^the ontology I want to search for$/) do
3N/A @name = 'Foobar'
3N/A @ontology = FactoryGirl.create :ontology, name: @name
3N/Aend
3N/A
3N/AWhen(/^I fill in the search form$/) do
3N/A within '#search_form_div' do
3N/A fill_in 'query', with: @name
3N/A end
3N/Aend
3N/A
268N/AThen(/^I should see the ontology$/) do
3N/A page.should have_content(@name)
3N/Aend
3N/A
59N/AThen(/^I shouldnt see the ontology$/) do
3N/A page.should_not have_content("{#@ontology.name}" + 'Foobar')
59N/Aend
416N/A
3N/AGiven(/^there is an ontology with a type$/) do
30N/A @ontology_type = FactoryGirl.create :ontology_type
175N/A @ontology = FactoryGirl.create :ontology, ontology_type: @ontology_type
30N/Aend
30N/A
30N/AWhen(/^I select the type I search for$/) do
30N/A within '#search_form_div' do
30N/A select @ontology_type.name, from: '_ontology_type'
30N/A end
30N/Aend
30N/A
30N/AThen(/^I should see all ontologies with that type$/) do
30N/A page.should have_content(@ontology.name)
30N/A page.should have_content(@ontology_type.name)
3N/Aend
416N/A
416N/AGiven(/^there is an ontology in a project$/) do
3N/A @project = FactoryGirl.create :project
416N/A @ontology = FactoryGirl.create :ontology, projects: [@project]
3N/Aend
3N/A
3N/AWhen(/^I select the project I search for$/) do
3N/A within '#search_form_div' do
526N/A select @project.name, from: '_project'
526N/A end
526N/Aend
526N/A
526N/AThen(/^I should see all ontologies in that project$/) do
526N/A page.should have_content(@ontology.name)
526N/A page.should have_content(@project.name)
526N/Aend
526N/A
526N/AGiven(/^there is an ontology with a formality level$/) do
526N/A @formality_level = FactoryGirl.create :formality_level
3N/A @ontology = FactoryGirl.create :ontology, formality_level: @formality_level
146N/Aend
526N/A
526N/AWhen(/^I select the formality I search for$/) do
526N/A within '#search_form_div' do
146N/A select @formality_level.name, from: '_formality_level'
146N/A end
3N/Aend
526N/A
526N/AThen(/^I should see all ontologies with that formality level$/) do
526N/A page.should have_content(@ontology.name)
3N/A page.should have_content(@formality_level.name)
416N/Aend
3N/A
429N/AGiven(/^there is an ontology with a license model$/) do
429N/A @license_model = FactoryGirl.create :license_model
429N/A @ontology = FactoryGirl.create :ontology, license_models: [@license_model]
30N/Aend
30N/A
30N/AWhen(/^I select the license model I search for$/) do
30N/A within '#search_form_div' do
30N/A select @license_model.name, from: '_license_model'
416N/A end
30N/Aend
30N/A
416N/AThen(/^I should see all ontologies with that license model$/) do
175N/A page.should have_content(@ontology.name)
30N/A page.should have_content(@license_model.name)
30N/Aend
30N/A
3N/AGiven(/^there is an ontology with a task$/) do
416N/A @task = FactoryGirl.create :task
416N/A @ontology = FactoryGirl.create :ontology, tasks: [@task]
3N/Aend
3N/A
416N/AWhen(/^I select the task I search for$/) do
416N/A within '#search_form_div' do
3N/A select @task.name, from: '_task'
3N/A end
3N/Aend
416N/A
416N/AThen(/^I should see all ontologies with that task$/) do
3N/A page.should have_content(@ontology.name)
3N/A page.should have_content(@task.name)
59N/Aend
416N/A
59N/AGiven(/^there is an ontology with all filters given$/) do
59N/A @ontology_type = FactoryGirl.create :ontology_type
59N/A @project = FactoryGirl.create :project
59N/A @formality_level = FactoryGirl.create :formality_level
59N/A @license_model = FactoryGirl.create :license_model
59N/A @task = FactoryGirl.create :task
59N/A @ontology = FactoryGirl.create :ontology, ontology_type: @ontology_type,
59N/A projects: [@project], formality_level: @formality_level,
3N/A license_models: [@license_model], tasks: [@task]
22N/Aend
3N/A
59N/AWhen(/^I select the all filters I search for$/) do
416N/A within '#search_form_div' do
526N/A select @ontology_type.name, from: '_ontology_type'
416N/A select @project.name, from: '_project'
526N/A select @formality_level.name, from: '_formality_level'
526N/A select @license_model.name, from: '_license_model'
526N/A select @task.name, from: '_task'
526N/A end
526N/Aend
526N/A
526N/AThen(/^I should see all ontologies with that features$/) do
526N/A page.should have_content(@ontology.name)
526N/A page.should have_content(@ontology_type.name)
416N/A page.should have_content(@project.name)
416N/A page.should have_content(@formality_level.name)
146N/A page.should have_content(@license_model.name)
416N/A page.should have_content(@task.name)
146N/Aend
146N/A
59N/AGiven(/^there is an ontology with a type which is in a project$/) do
526N/A @ontology_type = FactoryGirl.create :ontology_type
416N/A @project = FactoryGirl.create :project
416N/A @ontology = FactoryGirl.create :ontology, ontology_type: @ontology_type,
146N/A projects: [@project]
416N/Aend
146N/A
146N/AWhen(/^I select the type and project I search for$/) do
45N/A within '#search_form_div' do
526N/A select @ontology_type.name, from: '_ontology_type'
416N/A select @project.name, from: '_project'
416N/A end
146N/Aend
416N/A
146N/AThen(/^I should see all ontologies with that two features$/) do
146N/A page.should have_content(@ontology_type.name)
45N/A page.should have_content(@project.name)
175N/Aend
175N/A
526N/AThen(/^I should see all ontologies with that name$/) do
175N/A page.should have_content(@ontology.name)
526N/Aend
526N/A
526N/A