Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
Noah
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Noah
Commits
4e75f4ba
Commit
4e75f4ba
authored
Feb 26, 2011
by
John E. Vincent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ephemeral tests minus one due to timing issues
parent
e5af7b2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
ephemeral_spec.rb
spec/ephemeral_spec.rb
+26
-6
No files found.
spec/ephemeral_spec.rb
View file @
4e75f4ba
...
...
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe
"Using the Ephemeral Model"
,
:reset_redis
=>
true
do
before
(
:all
)
do
@edata
=
{
:path
=>
"/
/noah/
foo/bar/baz"
,
:data
=>
"some_value"
}
@edata
=
{
:path
=>
"/foo/bar/baz"
,
:data
=>
"some_value"
}
@emissing_path
=
@edata
.
reject
{
|
x
|
x
==
:path
}
@emissing_data
=
@edata
.
reject
{
|
x
|
x
==
:data
}
@good_ephemeral
=
Noah
::
Ephemeral
.
new
(
@edata
)
...
...
@@ -19,14 +19,34 @@ describe "Using the Ephemeral Model", :reset_redis => true do
it
"create a new Noah::Ephemeral"
do
@good_ephemeral
.
valid?
.
should
==
true
@good_ephemeral
.
save
b
=
Noah
::
Ephemeral
.
find
(
:path
=>
@edata
[
:path
]).
first
b
=
Noah
::
Ephemeral
[
@good_ephemeral
.
id
]
b
.
should
==
@good_ephemeral
end
it
"create a new Noah::Ephemeral with missing data"
it
"update an existing Noah::Ephemeral"
it
"delete an existing Noah::Ephemeral"
it
"create a new Noah::Ephemeral with missing data"
do
@missing_data
.
valid?
.
should
==
true
@missing_data
.
save
b
=
Noah
::
Ephemeral
[
@missing_data
.
id
]
b
.
should
==
@missing_data
end
# it "update an existing Noah::Ephemeral" do
# @good_ephemeral.save
# Noah::Ephemeral.all.size.should == 1
# c = Noah::Ephemeral[@good_ephemeral.id]
# c.data = "updated_data"
# c.save
# sleep(2)
# c.is_new?.should == false
# end
it
"delete an existing Noah::Ephemeral"
do
@good_ephemeral
.
save
@good_ephemeral
.
delete
Noah
::
Ephemeral
[
@good_ephemeral
.
id
].
should
==
nil
end
end
describe
"should not"
do
it
"create a new Noah::Ephemeral with missing path"
it
"create a new Noah::Ephemeral with missing path"
do
@missing_path
.
valid?
.
should
==
false
@missing_path
.
errors
.
should
==
[[
:path
,
:not_present
]]
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment