Skip to content

Instantly share code, notes, and snippets.

View donpinkster's full-sized avatar

Don Pinkster donpinkster

  • Sqills
  • Netherlands
View GitHub Profile
My great log
require "spec_helper"
describe User do
it { should allow_mass_assignment_of(:email) }
it { should allow_mass_assignment_of(:password) }
it { should allow_mass_assignment_of(:password_confirmation) }
it { should validate_uniqueness_of(:email) }
it { should allow_value("foo@bar.com").for(:email) }
it { should_not allow_value("blah").for(:email) }
<?php
$this->container->set('fixture.student', new Definition('Framework\Test\DependencyInjection\Fixture\Student', array(
new DefinitionArgument($this->container, 'fixture.person'),
new StaticArgument(Person::LENGTH)
)));
<?php
# src/tests/unit-tests/bootstrap.php
require_once('gwc.autoloader.php');
<?php
class User
{
protected $id;
protected $name;
public function setId($id)
{
$this->id = $id;
Feature: User Authentication
In order to play the game
As an registrered user
I want to be able to login
Background:
Given I have the user "john@doe.nl" with password "foobar"
Scenario: Logging in with incorrect credentials
Given I am on the login page
require 'spec_helper'
describe SessionController do
it "should show the login page at new action" do
get :new
response.should be_success
end
context "authentication failure" do
#!/usr/bin/ruby
zones_directory = "/var/named/slaves/*.hosts"
domains = Dir.glob(zones_directory).collect { |file| File.basename(file).sub(".hosts", "") }
domains.each do |domain|
print `rndc retransfer #{domain}`
end
<?php
class sfMessageSource_Doctrine extends sfMessageSource
{
public function &loadData($variant)
{
$rows = Doctrine_Query::create()
->from('TransUnit t')
->leftJoin('t.Catalogue c')
->where('c.name=?', $variant)
We couldn’t find that file to show.