diesel 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,108 @@
1
+ @disable-bundler
2
+ Feature: test a diesel engine using the bootstrapped application
3
+
4
+ Background:
5
+ Given a directory named "testengine"
6
+ When I cd to "testengine"
7
+ And I write to "Gemfile" with:
8
+ """
9
+ gem "rspec-rails", "~> 2.3.0"
10
+ gem "rails", "~> 3.0.3"
11
+ gem "sqlite3-ruby"
12
+ """
13
+ When I add this library as a dependency
14
+ And I write to "spec/spec_helper.rb" with:
15
+ """
16
+ ENV["RAILS_ENV"] ||= 'test'
17
+ require "diesel/testing"
18
+ require 'rspec/rails'
19
+ """
20
+ When I write to "config/routes.rb" with:
21
+ """
22
+ Rails.application.routes.draw do
23
+ match "/hello", :to => 'example#hello'
24
+ end
25
+ """
26
+
27
+ Scenario: use root_url
28
+ When I write to "spec/controllers/example_controller_spec.rb" with:
29
+ """
30
+ require 'spec_helper'
31
+ describe ExampleController do
32
+ it "renders hello" do
33
+ get :hello
34
+ response.should redirect_to("/")
35
+ end
36
+ end
37
+ """
38
+ When I write to "app/controllers/example_controller.rb" with:
39
+ """
40
+ class ExampleController < ActionController::Base
41
+ def hello
42
+ redirect_to root_url
43
+ end
44
+ end
45
+ """
46
+ When I run "bundle exec rspec --format documentation spec"
47
+ Then it should pass with:
48
+ """
49
+ 0 failures
50
+ """
51
+ Then at least one example should have run
52
+
53
+ Scenario: use ApplicationController
54
+ When I write to "spec/controllers/example_controller_spec.rb" with:
55
+ """
56
+ require 'spec_helper'
57
+ describe ExampleController do
58
+ it "renders hello" do
59
+ get :hello
60
+ response.should be_success
61
+ end
62
+ end
63
+ """
64
+ When I write to "app/controllers/example_controller.rb" with:
65
+ """
66
+ class ExampleController < ApplicationController
67
+ def hello
68
+ render :nothing => true
69
+ end
70
+ end
71
+ """
72
+ When I run "bundle exec rspec --format documentation spec"
73
+ Then it should pass with:
74
+ """
75
+ 0 failures
76
+ """
77
+ Then at least one example should have run
78
+
79
+ Scenario: use application layout
80
+ When I write to "spec/controllers/example_controller_spec.rb" with:
81
+ """
82
+ require 'spec_helper'
83
+ describe ExampleController do
84
+ it "renders hello" do
85
+ get :hello
86
+ response.should be_success
87
+ end
88
+ end
89
+ """
90
+ When I write to "app/controllers/example_controller.rb" with:
91
+ """
92
+ class ExampleController < ActionController::Base
93
+ def hello
94
+ render :layout => 'application'
95
+ end
96
+ end
97
+ """
98
+ When I write to "app/views/example/hello.html.erb" with:
99
+ """
100
+ hello
101
+ """
102
+ When I run "bundle exec rspec --format documentation spec"
103
+ Then it should pass with:
104
+ """
105
+ 0 failures
106
+ """
107
+ Then at least one example should have run
108
+
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ end
3
+
@@ -7,7 +7,10 @@ module Diesel
7
7
  class Application < Rails::Application
8
8
  config.encoding = "utf-8"
9
9
  config.action_mailer.default_url_options = { :host => 'localhost' }
10
- config.paths.config.database = "#{APP_ROOT}/database.yml"
10
+ config.paths.config.database = "#{APP_ROOT}/config/database.yml"
11
+ config.paths.config.routes << "#{APP_ROOT}/config/routes.rb"
12
+ config.paths.app.controllers << "#{APP_ROOT}/app/controllers"
13
+ config.paths.app.views << "#{APP_ROOT}/app/views"
11
14
  config.paths.log = "tmp/log"
12
15
  config.cache_classes = true
13
16
  config.whiny_nils = true
@@ -0,0 +1,4 @@
1
+ Rails.application.routes.draw do
2
+ root :to => "application#show"
3
+ end
4
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diesel
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - thoughtbot, inc.
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-12-22 00:00:00 -05:00
19
+ date: 2011-01-10 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -51,10 +51,14 @@ files:
51
51
  - lib/diesel/generators/features_base.rb
52
52
  - lib/diesel/generators/install_base.rb
53
53
  - lib/diesel/generators/views_base.rb
54
+ - lib/diesel/testing/app/controllers/application_controller.rb
55
+ - lib/diesel/testing/app/views/layouts/application.html.erb
54
56
  - lib/diesel/testing/application.rb
55
- - lib/diesel/testing/database.yml
57
+ - lib/diesel/testing/config/database.yml
58
+ - lib/diesel/testing/config/routes.rb
56
59
  - lib/diesel/testing/integration.rb
57
60
  - lib/diesel/testing.rb
61
+ - features/application_bootstrap.feature
58
62
  - features/cucumber_testing.feature
59
63
  - features/features_generator.feature
60
64
  - features/install_generator.feature
@@ -98,6 +102,7 @@ signing_key:
98
102
  specification_version: 3
99
103
  summary: Diesel makes your engine go.
100
104
  test_files:
105
+ - features/application_bootstrap.feature
101
106
  - features/cucumber_testing.feature
102
107
  - features/features_generator.feature
103
108
  - features/install_generator.feature