f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksarequire 'spec_helper'
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksadescribe Logic do
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa context 'Logic instance' do
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let(:user) { create :user }
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let(:logic) { create :logic, user: user }
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa it 'have to_s' do
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa expect(logic.to_s).to eq(logic.name)
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa end
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa it 'allow http scheme for IRI' do
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa expect do
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa logic.iri = 'http://example.com/logic'
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa logic.save!
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa end.not_to raise_error
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa end
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa it 'allow URN scheme for IRI' do
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa expect do
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa logic.iri = 'urn:logic:CommonLogic'
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa logic.save!
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa end.not_to raise_error
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa end
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa it 'not allow ftp scheme for IRI' do
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa expect do
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa logic.iri = 'ftp://example.com/logic'
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa logic.save!
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa end.to raise_error(ActiveRecord::RecordInvalid)
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa end
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksa end
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2Eugen Kuksaend