792e63782d113aa39e658471cf466863e97b852bTim Reddehase @distributed_ontology = FactoryGirl.create :distributed_ontology, :with_versioned_children
ff5afcf3b8fafaf548d638855881f710ba2e0fb1Tom Gehrke repository.save_file_only(f.path, @ontology.path, 'add ontology file', user)
792e63782d113aa39e658471cf466863e97b852bTim ReddehaseWhen(/^i visit the versions tab of a child ontology$/) do
792e63782d113aa39e658471cf466863e97b852bTim Reddehase @ontology = @distributed_ontology.children.first
792e63782d113aa39e658471cf466863e97b852bTim Reddehase visit repository_ontology_ontology_versions_path(@ontology.repository, @ontology)
792e63782d113aa39e658471cf466863e97b852bTim ReddehaseThen(/^i should see the corresponding versions$/) do
6cf7dfa3f4a9dd506fc39a1aed4dc0c29ea814d2Eugen Kuksa selector = %(.evaluation-state[data-id="#{id}"][data-klass="OntologyVersion"])
13aeda174b4d9b5850ccc2c04d02e0def35ca634Tom GehrkeWhen(/^I visit the versions tab of the ontology$/) do
13aeda174b4d9b5850ccc2c04d02e0def35ca634Tom Gehrke visit repository_ontology_ontology_versions_path(@ontology.repository, @ontology)
13aeda174b4d9b5850ccc2c04d02e0def35ca634Tom GehrkeThen(/^I should see a "(.*?)" button for each version$/) do |text|
13aeda174b4d9b5850ccc2c04d02e0def35ca634Tom GehrkeThen(/^I shouldn't see a "(.*?)" button for each version$/) do |text|
13aeda174b4d9b5850ccc2c04d02e0def35ca634Tom GehrkeGiven(/^I have permissions to edit the ontology$/) do
13aeda174b4d9b5850ccc2c04d02e0def35ca634Tom Gehrke perm = FactoryGirl.create :permission, subject: @user, item: @ontology.repository
13aeda174b4d9b5850ccc2c04d02e0def35ca634Tom GehrkeThen(/^I should see a "(.*?)" button for the latest version$/) do |text|
13aeda174b4d9b5850ccc2c04d02e0def35ca634Tom Gehrke @edit_button = first(:css, 'tbody > tr').find_link(text)
13aeda174b4d9b5850ccc2c04d02e0def35ca634Tom Gehrke expect(first(:css, 'tbody > tr')).to have_link(text)
13aeda174b4d9b5850ccc2c04d02e0def35ca634Tom GehrkeThen(/^I should see a "(.*?)" button for every other version$/) do |text|
13aeda174b4d9b5850ccc2c04d02e0def35ca634Tom Gehrke all(:css, 'tbody > tr:nth-of-type(n+2)').each do |row|
13aeda174b4d9b5850ccc2c04d02e0def35ca634Tom GehrkeGiven(/^there is a newer "(.*?)" version$/) do |state|
13aeda174b4d9b5850ccc2c04d02e0def35ca634Tom Gehrke @ontology_version = FactoryGirl.create :ontology_version, state: state, ontology: @ontology