Skip to content

Instantly share code, notes, and snippets.

Ogredude ogredude

Block or report user

Report or block ogredude

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:6532387
/**
* Fills in form field with specified id|name|label|value.
*
* @When /^(?:|I )fill in "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/
* @When /^(?:|I )fill in "(?P<field>(?:[^"]|\\")*)" with:$/
* @When /^(?:|I )fill in "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)"$/
*/
public function fillField($field, $value)
{
$field = $this->fixStepArgument($field);
@ogredude
ogredude / gist:1078874
Created Jul 12, 2011 — forked from szymon-przybyl/gist:1078859
UsersConroller#create spec
View gist:1078874
describe 'POST create' do
context 'with valid params' do
before(:each) { User.any_instance.stub!(:valid?).and_return(true) }
it 'creates new user and redirects to the home page with a notice' do
post :create, :user => Factory.attributes_for(:user, :username => 'dude')
assigns[:user].should be_persisted
# assigns[:user].username.should eq('dude') # Unnecessary, model tests should cover this
flash[:notice].should_not be_blank # be_blank instead of be_nil
response.should redirect_to(root_path) # path here, not url
end
You can’t perform that action at this time.