Cross Reference: theorem_spec.rb
xref
: /
ontohub
/
spec
/
models
/
theorem_spec.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
theorem_spec.rb revision ad3d2e33936e011b85cbcaada213ff2fd732766f
715
N/A
require
'spec_helper'
715
N/A
715
N/A
describe
Theorem
do
715
N/A
context
'Associations'
do
715
N/A
it
{
should
have_many
(:
proof_attempts
)
}
715
N/A
it
{
should
belong_to
(:
proof_status
)
}
715
N/A
end
715
N/A
715
N/A
context
'update_proof_status'
do
715
N/A
let
(:
success
)
{
create
:
proof_status_success
}
715
N/A
let
(:
proven
)
{
create
:
proof_status_proven
}
715
N/A
let
(:
unknown
)
{
create
:
proof_status_unknown
}
715
N/A
715
N/A
context
'from solved status'
do
715
N/A
let
(:
theorem
)
{
create
:
theorem
,
proof_status
:
success
}
715
N/A
715
N/A
context
'to solved status'
do
715
N/A
before
{
theorem.update
_proof_status
(
proven
)
}
715
N/A
715
N/A
it
'theorem has updated status'
do
715
N/A
expect
(
theorem.proof
_status
)
.
to
eq
(
proven
)
715
N/A
end
715
N/A
end
715
N/A
715
N/A
context
'to unsolved status'
do
715
N/A
before
{
theorem.update
_proof_status
(
unknown
)
}
715
N/A
715
N/A
it
'theorem still has previous status'
do
715
N/A
expect
(
theorem.proof
_status
)
.
to
eq
(
success
)
715
N/A
end
715
N/A
end
715
N/A
end
715
N/A
715
N/A
context
'from unsolved status'
do
715
N/A
let
(:
theorem
)
{
create
:
theorem
,
proof_status
:
unknown
}
715
N/A
715
N/A
context
'to solved status'
do
715
N/A
before
{
theorem.update
_proof_status
(
proven
)
}
726
N/A
726
N/A
it
'theorem has updated status'
do
726
N/A
expect
(
theorem.proof
_status
)
.
to
eq
(
proven
)
715
N/A
end
715
N/A
end
715
N/A
717
N/A
context
'to unsolved status'
do
717
N/A
before
{
theorem.update
_proof_status
(
unknown
)
}
715
N/A
715
N/A
it
'theorem has updated status'
do
718
N/A
expect
(
theorem.proof
_status
)
.
to
eq
(
unknown
)
718
N/A
end
718
N/A
end
726
N/A
end
715
N/A
end
715
N/A
end
715
N/A