Skip to content

Instantly share code, notes, and snippets.

@stevemcquaid
Created October 8, 2014 00:30
Show Gist options
  • Save stevemcquaid/b6d1d2d3eadebe5cd8fd to your computer and use it in GitHub Desktop.
Save stevemcquaid/b6d1d2d3eadebe5cd8fd to your computer and use it in GitHub Desktop.
require "rails_helper"
RSpec.describe Invitation do
context "with a new object" do
it "should create a new instance given a valid attribute" do
invitation = Invitation.create!(
:sender_id => 1,
:recipient_email => "abc@example.com",
:token => "knjg1h2uye47fuygdwbfhshijdsap90afs9u8y7",
:sent_at => Time.now
)
expect(invitation).to be_valid
end
end
end
#### OUTPUT #####
# 20) Invitation with a new object should create a new instance given a valid attribute
# Failure/Error: invitation = Invitation.create!(
# ActiveRecord::RecordInvalid:
# Validation failed: Recipient email can't be blank
# # ./spec/models/invitation_spec.rb:6:in `block (3 levels) in <top (required)>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment