Cross Reference: logic_spec.rb
xref
: /
ontohub
/
spec
/
models
/
logic_spec.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
require
'spec_helper'
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
describe
Logic
do
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
context
'Logic instance'
do
7c7a19761235efff584ee65a1c6dc4aa1735ff64
Eugen Kuksa
let
(:
user
)
{
create
:
user
}
7c7a19761235efff584ee65a1c6dc4aa1735ff64
Eugen Kuksa
let
(:
logic
)
{
create
:
logic
,
user
:
user
}
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
it
'have to_s'
do
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
expect
(
logic.to
_s
)
.
to
eq
(
logic.name
)
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
end
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
it
'allow http scheme for IRI'
do
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
expect
do
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
logic.iri
=
'
http://example.com/logic
'
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
logic.save
!
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
end.not
_to
raise_error
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
end
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
it
'allow URN scheme for IRI'
do
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
expect
do
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
logic.iri
=
'urn:logic:CommonLogic'
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
logic.save
!
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
end.not
_to
raise_error
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
end
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
it
'not allow ftp scheme for IRI'
do
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
expect
do
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
logic.iri
=
'
ftp://example.com/logic
'
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
logic.save
!
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
end.to
raise_error
(
ActiveRecord
::
RecordInvalid
)
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
end
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
end
f0e0f09f12a9e9ce36023d339a7e35548df5bbc2
Eugen Kuksa
end