Guest User

Untitled

a guest
Apr 25th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. describe "a well formed invitation", :shared => true do
  2. it "should be valid" do
  3. invitation.should be_valid
  4. end
  5.  
  6. it "should have saved succesfully" do
  7. invitation.should_not be_new_record
  8. end
  9. end
  10.  
  11. describe "Creating an invitation from_params" do
  12. before(:each) do
  13. @params = valid_invitation_params
  14. @invitation = nil
  15. end
  16.  
  17. def invitation
  18. @invitation ||= Invitation.from_params(@params)
  19. end
  20.  
  21. describe "with all possible data" do
  22. it_should_behave_like "a well formed invitation"
  23. end
  24.  
  25. describe "with only required data" do
  26. before(:each) do
  27. @params.except!(:email, :personal_msg)
  28. end
  29.  
  30. it_should_behave_like "a well formed invitation"
  31. end
  32. end
Add Comment
Please, Sign In to add comment