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