oops_request_controller_test.rb revision ef1f1ad3d88023d93475dfdce00bd9f230917660
require 'test_helper'
context 'OntologyVersion OOPS-Integration' do
should route(:get, "/repositories/1/ontologies/12/versions/45/oops_request").to(:controller => :oops_requests, :action => :show, :repository_id => '1', :ontology_id => '12', :ontology_version_id => '45' )
should route(:post, "/repositories/1/ontologies/12/versions/45/oops_request").to(:controller => :oops_requests, :action => :create, :repository_id => '1', :ontology_id => '12', :ontology_version_id => '45')
setup do
end
context 'on GET to oops' do
setup do
end
context 'test with OOPS!' do
setup do
post :create, :repository_id => @repository.to_param, :ontology_id => @ontology.to_param, :ontology_version_id => @version.number, :format => :json
end
#should set_the_flash.to(/Your request is send to OOPS!/i)
end
context 'send second request' do
context 'while pending, processing or done' do
setup do
post :create, :repository_id => @repository.to_param, :ontology_id => @ontology.to_param, :ontology_version_id => @version.number, :format => :json
end
#should set_the_flash.to(/Already send to OOPS/i)
end
context 'when failed' do
setup do
post :create, :repository_id => @repository.to_param, :ontology_id => @ontology.to_param, :ontology_version_id => @version.number, :format => :json
end
end
end
context 'on GET to SHOW' do
context 'with OopsRequest' do
setup do
get :show, :repository_id => @repository.to_param, :ontology_id => @ontology.to_param, :ontology_version_id => @version.number, :format => :json
end
end
context 'without OopsRequest' do
should "raise not found" do
get :show, :repository_id => @repository.to_param, :ontology_id => @ontology.to_param, :ontology_version_id => @version.number, :format => :json
end
end
end
end
end
end
end