Skip to content

Commit

Permalink
Grouped tests without side-effects on the same context, to avoid cont…
Browse files Browse the repository at this point in the history
…ext switching, thus, speeding up tests a little bit :)
  • Loading branch information
Cainã Costa committed Feb 17, 2011
1 parent b077bcc commit 6a04295
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions test/request_logger_test.rb
Expand Up @@ -55,16 +55,11 @@
asserts("counter hasn't incremented") { db['views'].count }.equals 0
end

context "should save the path of the access" do
setup { get '/' }

asserts('it should have a time key') { db['views'].find_one }.includes 'path'
asserts('it should have a time set') { db['views'].find_one['path'] }.equals '/'
end

context "should save the time of the access" do
context "should save the path and the time of the access" do
setup { get '/' }

asserts('it should have a path key') { db['views'].find_one }.includes 'path'
asserts('it should have a path set') { db['views'].find_one['path'] }.equals '/'
asserts('it should have a time key') { db['views'].find_one }.includes 'time'
asserts('it should have a time set') { db['views'].find_one['time'] }.kind_of Time
end
Expand Down

0 comments on commit 6a04295

Please sign in to comment.