Skip to content

Commit

Permalink
Registration with BDD
Browse files Browse the repository at this point in the history
  • Loading branch information
foxted committed Jul 7, 2014
1 parent 3ce657a commit b8cf292
Show file tree
Hide file tree
Showing 21 changed files with 4,073 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -8,3 +8,5 @@ composer.lock
.env.php
.DS_Store
Thumbs.db

tests/_output/*
30 changes: 30 additions & 0 deletions app/controllers/RegistrationController.php
@@ -0,0 +1,30 @@
<?php

/**
* Class RegistrationController
*
* @author Valentin PRUGNAUD <valentin@whatdafox.com>
* @url http://www.foxted.com
*/
class RegistrationController extends \BaseController
{

/**
* Show a form to register the user
* @return Response
*/
public function create()
{
return View::make('registration.create');
}

/**
* Create a new Larabook user
* @return string
*/
public function store()
{
return Redirect::home();
}

}
27 changes: 16 additions & 11 deletions app/routes.php
@@ -1,14 +1,19 @@
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
Route::get('/', [
'as' => 'home',
'uses' => 'PagesController@home'
]);

Route::get('/', 'PagesController@home');
/**
* Registration
*/
Route::get('register', [
'as' => 'register_path',
'uses' => 'RegistrationController@create'
]);

Route::post('register', [
'as' => 'register_path',
'uses' => 'RegistrationController@store'
]);
2 changes: 1 addition & 1 deletion app/views/pages/home.blade.php
Expand Up @@ -9,7 +9,7 @@
fuss is about?</p>

<p>
<a class="btn btn-lg btn-primary" href="../../components/#navbar" role="button">Sign Up »</a>
{{ link_to_route('register_path', 'Sign Up!', null, ['class' => 'btn btn-lg btn-primary']) }}
</p>
</div>
@stop
33 changes: 33 additions & 0 deletions app/views/registration/create.blade.php
@@ -0,0 +1,33 @@
@extends('layouts.default')

@section('content')
<h1>Register!</h1>

{{ Form::open(['route' => 'register_path']) }}

<div class="form-group">
{{ Form::label('username', 'Username:') }}
{{ Form::text('username', null, ['class' => 'form-control']) }}
</div>

<div class="form-group">
{{ Form::label('email', 'Email:') }}
{{ Form::text('email', null, ['class' => 'form-control']) }}
</div>

<div class="form-group">
{{ Form::label('password', 'Password:') }}
{{ Form::password('password', ['class' => 'form-control']) }}
</div>

<div class="form-group">
{{ Form::label('password_confirmation', 'Password Confirmation:') }}
{{ Form::password('password_confirmation', ['class' => 'form-control']) }}
</div>

<div class="form-group">
{{ Form::submit('Sign Up', ['class' => 'btn btn-primary']) }}
</div>

{{ Form::close() }}
@stop
9 changes: 4 additions & 5 deletions bootstrap/start.php
Expand Up @@ -24,11 +24,10 @@
|
*/

$env = $app->detectEnvironment(array(

'local' => array('homestead'),

));
$env = $app->detectEnvironment(function()
{
return getenv('APP_ENV')?:'production';
});

/*
|--------------------------------------------------------------------------
Expand Down
17 changes: 17 additions & 0 deletions codeception.yml
@@ -0,0 +1,17 @@
actor: Tester
paths:
tests: tests
log: tests/_output
data: tests/_data
helpers: tests/_support
settings:
bootstrap: _bootstrap.php
colors: true
memory_limit: 1024M
modules:
config:
Db:
dsn: ''
user: ''
password: ''
dump: tests/_data/dump.sql
2 changes: 2 additions & 0 deletions tests/_bootstrap.php
@@ -0,0 +1,2 @@
<?php
// This is global bootstrap for autoloading
10 changes: 10 additions & 0 deletions tests/_support/AcceptanceHelper.php
@@ -0,0 +1,10 @@
<?php
namespace Codeception\Module;

// here you can define custom actions
// all public methods declared in helper class will be available in $I

class AcceptanceHelper extends \Codeception\Module
{

}
10 changes: 10 additions & 0 deletions tests/_support/FunctionalHelper.php
@@ -0,0 +1,10 @@
<?php
namespace Codeception\Module;

// here you can define custom actions
// all public methods declared in helper class will be available in $I

class FunctionalHelper extends \Codeception\Module
{

}
10 changes: 10 additions & 0 deletions tests/_support/UnitHelper.php
@@ -0,0 +1,10 @@
<?php
namespace Codeception\Module;

// here you can define custom actions
// all public methods declared in helper class will be available in $I

class UnitHelper extends \Codeception\Module
{

}
14 changes: 14 additions & 0 deletions tests/acceptance.suite.yml
@@ -0,0 +1,14 @@
# Codeception Test Suite Configuration

# suite for acceptance tests.
# perform tests in browser using the WebDriver or PhpBrowser.
# If you need both WebDriver and PHPBrowser tests - create a separate suite.

class_name: AcceptanceTester
modules:
enabled:
- PhpBrowser
- AcceptanceHelper
config:
PhpBrowser:
url: 'http://localhost/myapp/'

0 comments on commit b8cf292

Please sign in to comment.