Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
trying to create an integration spec to test a nested resource (location is a nested resource of mailbox).
require 'spec_helper'
feature "Editing mailboxes" do
scenario "Updating a mailbox" do
let!(:mailbox) { Factory(:mailbox) }
let!(:location) { Factory(:location, :street_one => "6th NE", :street_two => "Kent NE", :zip => '99999', :city => "Auburn", :state => 'WA', :mailbox => mailbox) }
visit '/'
click_link '6th NE and Kent NE'
click_link 'Edit mailbox'
fill_in "Street One", :with => "7th NW"
click_link "Update mailbox"
page.should have_content "Mailbox has been updated"
page.should have_content "7th NW and Kent NE"

This comment has been minimized.

Copy link
Owner Author

@kris-luminar kris-luminar commented Feb 12, 2013

I've gotten farther along in the text and I'm now thinking something along these lines will do the trick:

user = Factory(:user)
ticket = Factory(:ticket,
                 :project => textmate_2,
                 :title   => "Make it shiny!",
                 :description => "Gradients! Starbursts! Oh my!")
ticket.update_attribute(:user, user)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.