-
-
Notifications
You must be signed in to change notification settings - Fork 468
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ Updated installer to remove Diesel + Added new templates for generating features + Removed unused step definitions
- Loading branch information
Showing
28 changed files
with
304 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
When /^I add the "([^"]*)" gem$/ do |gem_name| | ||
append_to_file('Gemfile', %{\ngem "#{gem_name}"\n}) | ||
end | ||
|
||
When /^I add the "([^"]*)" gem from this project$/ do |gem_name| | ||
append_to_file('Gemfile', %{\ngem "#{gem_name}", :path => "../../.."\n}) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
features/support/clearance.rb → ...app/controllers/application_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,7 @@ | ||
require 'clearance' | ||
|
||
Clearance.configure do |config| | ||
end | ||
|
||
class ApplicationController < ActionController::Base | ||
include Clearance::Authentication | ||
|
||
def show | ||
render :text => '', :layout => 'application' | ||
end | ||
end | ||
|
||
class User < ActiveRecord::Base | ||
include Clearance::User | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
require 'rails/all' | ||
|
||
module Clearance | ||
module Testing | ||
APP_ROOT = File.expand_path('..', __FILE__).freeze | ||
|
||
class Application < Rails::Application | ||
config.encoding = "utf-8" | ||
config.action_mailer.default_url_options = { :host => 'localhost' } | ||
|
||
if Rails::VERSION::MAJOR >= 3 && Rails::VERSION::MINOR >= 1 | ||
config.paths['config/database'] = "#{APP_ROOT}/config/database.yml" | ||
config.paths['config/routes'] << "#{APP_ROOT}/config/routes.rb" | ||
config.paths['app/controllers'] << "#{APP_ROOT}/app/controllers" | ||
config.paths['app/views'] << "#{APP_ROOT}/app/views" | ||
config.paths['log'] = "tmp/log/development.log" | ||
config.assets.enabled = true | ||
else | ||
config.paths.config.database = "#{APP_ROOT}/config/database.yml" | ||
config.paths.config.routes << "#{APP_ROOT}/config/routes.rb" | ||
config.paths.app.controllers << "#{APP_ROOT}/app/controllers" | ||
config.paths.app.views << "#{APP_ROOT}/app/views" | ||
config.paths.log = "tmp/log" | ||
end | ||
|
||
config.cache_classes = true | ||
config.whiny_nils = true | ||
config.consider_all_requests_local = true | ||
config.action_controller.perform_caching = false | ||
config.action_dispatch.show_exceptions = false | ||
config.action_controller.allow_forgery_protection = false | ||
config.action_mailer.delivery_method = :test | ||
config.active_support.deprecation = :stderr | ||
config.secret_token = "SECRET_TOKEN_IS_MIN_30_CHARS_LONG" | ||
|
||
def require_environment! | ||
initialize! | ||
end | ||
|
||
def initialize! | ||
FileUtils.mkdir_p(Rails.root.join("db").to_s) | ||
super unless @initialized | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
development: | ||
adapter: sqlite3 | ||
database: db/development.sqlite3 | ||
pool: 5 | ||
timeout: 5000 | ||
|
||
test: | ||
adapter: sqlite3 | ||
database: db/test.sqlite3 | ||
pool: 5 | ||
timeout: 5000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Rails.application.routes.draw do | ||
root :to => "application#show" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Description: | ||
Generate Cucumber features and step definitions | ||
|
||
Examples: | ||
rails generate clearance:cucumber_features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
require 'diesel/generators/features_base' | ||
require 'rails/generators/base' | ||
|
||
module Clearance | ||
module Generators | ||
class FeaturesGenerator < Diesel::Generators::FeaturesBase | ||
class FeaturesGenerator < Rails::Generators::Base | ||
source_root File.expand_path('../templates', __FILE__) | ||
|
||
def create_features | ||
directory 'features' | ||
end | ||
|
||
def create_factories | ||
directory 'spec' | ||
end | ||
end | ||
end | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
lib/generators/clearance/features/templates/spec/factories/clearance.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FactoryGirl.define do | ||
sequence :email do |n| | ||
"user#{n}@example.com" | ||
end | ||
|
||
factory :user do | ||
password "password" | ||
end | ||
end |
Oops, something went wrong.