Skip to content

Instantly share code, notes, and snippets.

@aviflombaum
Created February 15, 2012 23:39
Show Gist options
  • Select an option

  • Save aviflombaum/1840078 to your computer and use it in GitHub Desktop.

Select an option

Save aviflombaum/1840078 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe ProfilesController do
context "as a User" do
before(:each) do
@user = Factory(:user)
login_as(@user)
end
context "create a Profile" do
context "given invalid attributes" do
before(:each) do
invalid_params = {:bio => ""}
post :create, {:user_id => @user.id}.merge(invalid_params)
end
it "rejects a blank bio" do
assigns(:profile).should_not be_valid
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment