Guest User

Untitled

a guest
Jan 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. require 'spec_helper'
  2.  
  3. describe "transactions" do
  4. before :all do
  5. @device = Factory(:device)
  6. end
  7.  
  8. it "has one device before a nested context" do
  9. Device.count.should == 1
  10. end
  11.  
  12. describe "in a nested context" do
  13. before :all do
  14. @device2 = Factory(:device)
  15. end
  16.  
  17. it "has two devices" do
  18. Device.count.should == 2
  19. end
  20. end
  21.  
  22. describe "in another nested context" do
  23. before :all do
  24. @device2 = Factory(:device)
  25. end
  26.  
  27. it "has two devices" do
  28. Device.count.should == 2
  29. end
  30. end
  31.  
  32. it "has one device after a nested context" do
  33. Device.count.should == 1
  34. end
  35. end
  36.  
  37. describe "another top-level example group" do
  38. it "has no devices" do
  39. Device.count.should == 0
  40. end
  41. end
Add Comment
Please, Sign In to add comment