Skip to content

Loading…

Update test names and locations #7878

Merged
merged 1 commit into from
@blowmage

As discussed on the rubyonrails-core mailing list, this request changes the default test locations as follows:

test/units          -> test/models
test/units/helpers  -> test/helpers
test/functional     -> test/controllers
test/functional     -> test/mailers
test/integration    -> test/acceptance

The existing rake tasks are backwards compatible, and will run tests in the old and new locations. New rake tasks were added that only runs the tests in the new locations. The new tasks are test:models, test:helpers, test:controllers, test:mailers, and test:acceptance.

attn: @spastorino and @tenderlove

@steveklabnik
Ruby on Rails member

:shipit:

Looks good. Thanks for this work. :heart:

@xenda

:shipit:
This is a move made with pure love.

@jeremy
Ruby on Rails member

@blowmage could you squash the commits?

Not sure about changing integration -> acceptance. That one doesn't seem necessary.

@steveklabnik
Ruby on Rails member

FWIW, rspec calls them 'request' specs, since they test a request.

@xenda

:+1: to requests, if it's open to discussion.

@blowmage

@jeremy Yes, I can squash if/when given a :thumbsup: for accepting the pull request.

I don't think the name "integration" is appropriate is going on in the integration tests. The tests exercise the whole stack, from the router/dispatcher to the controller, views, models, etc. The tests can have one session with multiple requests. Both "integration" and "request" are too narrow IMO. I would love a discussion on a better term.

http://c2.com/cgi/wiki?AcceptanceTest
http://c2.com/cgi/wiki?IntegrationTest

@stevenharman

Rspec calls them 'request' or 'acceptance' tests, depending on how you roll.

My tendency is to go with spec/acceptance and to limit those to true acceptance tests - driven from the outside, from the perspective of the consumer, ignorant of as many implementation details as possible.

@steveklabnik
Ruby on Rails member

Seems legit.

@coreyhaines

+1 - will be nice to see the old confusion-causing names drift away

@josevalim
Ruby on Rails member
@zires

Looks more clear. :+1:

@jeremy
Ruby on Rails member

Integration tests are really HTTP resource tests. They're called "integration" to indicate that they exercise the whole app stack.

I'd consider calling these Resource tests instead of Integration tests, in keeping with the other changes from "how we're testing this" to "what we're testing."

@steveklabnik
Ruby on Rails member

Uuuuuuuuugh. I really, really don't want to bikeshed this, but Rails messes up the REST terminology so bad already, can we just stay away from that?

@garybernhardt

+1 on everything except acceptance; -1000 on that. Call it "integration", "system", "request", whatever. Just don't call it "acceptance". Acceptance is not a test scope; it's a test objective. An acceptance test can be isolated to ten lines of code or integrating across 10,000.

@steveklabnik
Ruby on Rails member

After some discussion, I agree with @jeremy. 'resource' seems like a reasonable name.

@koffeinfrei

I agree with @garybernhardt that acceptance is not a test scope, though in most cases acceptance tests are functional tests. They differ from integration tests in that they are black box tests which test the application as a whole, disregarding any knowledge of the internals. Integration tests are basically unit tests with an external dependency, e.g. model tests.

Since functional is already taken as a legacy term I favor system tests.
That said, I'd still prefer acceptance over integration though.

@dvrensk

+1 on request tests. Acceptance testing has been the prevalent test type long before automated testing was known to more than 1% of developers, and it is still something that most enterprise projects can not be done without manual testing. Taking a term with a long history and slapping it onto something that fits in the framework at hand is exactly the mistake that we are trying to fix by renaming 'unit tests' to 'model tests'. Please don't repeat that mistake.

(I know that I make exact and unsubstantiated claims above, but I hope that you agree with the reasoning anyway.)

@blowmage

Here are my thoughts. I agree with @koffeinfrei's definition of the term "functional" and to my thinking it is the most appropriate one to use, but it would cause confusion since the term has already been used by rails and I was asked to maintain backwards compatibility in this change. It looks like "request" is the most popular term but I think it is too narrow; many of these tests involve multiple HTTP requests. Also, it appears to have been deprecated in RSpec. I am intrigued by the term "resource", but again they can exercise several REST-ish resources in a single test and I think that could cause confusion. That leaves "system", which describes the right scope for these tests, but I have usually thought of system tests as QA tests and not developer tests.

In summary, here are the terms discussed so far in order of my personal preference and considering the trade-offs I shared above:

  • system
  • acceptance
  • resource
  • request
  • functional
  • integration
@stevenharman

Given the options, and all of the feedback, I too am inclined toward acceptance. However, I realize I may be biased and have a personal style which lends itself to calling them acceptance.

[My tendency is to] limit those to true acceptance tests - driven from the outside, from the
perspective of the consumer, ignorant of as many implementation details as possible.

The most compelling reasons I've heard against acceptance is @garybernhardt's objection that acceptance is an objective not a scope. While true in part, it has also long been used as a label for a style of testing (see: http://c2.com/cgi/wiki?AcceptanceTest).

Perhaps there is no great term that is free of preconception and/or prior definition?

@blowmage

FWIW, the reason "acceptance" wasn't top of my list was because of the objections of some core members. I agree with @stevenharman's comment since that is how I use these tests and why I originally chose the term. I would be perfectly happy if it was kept.

@justinko

requests please.

Also, please add test:lib.

@jasonroelofs

@justinko Given that Rails doesn't generate lib or set up an autoload path for it anymore, it probably shouldn't be added here.

I vote for acceptance, I'm familiar with that terminology.

@blowmage

@justinko I have an idea for a separate pull request that will address generating rake tasks for additional directories under test. So tests in test/lib and test/presenters and test/serializers and test/decorators would be run with:

rake test:lib
rake test:presenters
rake test:serializers
rake test:decorators

But that will be a separate pull request. :)

@justinko

Who is accepting the acceptance tests?

@stevenharman

My workflow tends to look something like:

  1. write acceptance test in high-level prose, from the perspective of the consumer.
  2. when there is an embedded customer, review the test with them. Lacking that, I put on my customer hat and do my best to think like a consumer.
  3. start turning the test green by implementing the prose, outside-in. (For me this often means rspec driving capybara, with numbers of lower-level developer tests as I move down through my feedback loops.)
  4. when the outer test goes green, I'm done. Review the test again (with my customer hat on if necessary) to make sure my expectations are still met.

After that the test becomes an artifact and is mostly used to as a regression safety net and to remind myself and others of the intention and desired value of the feature.

All of that said, I fully understand that others don't work that way. It seems @blowmage and I may have similar styles which is why we are advocating, or at least not against the term acceptance. Perhaps others find the term too prescriptive?

@stevenharman

Question: is all of the contention around the name acceptance caused by feelings of it being too prescriptive? I can certainly understand if that's the issue - especially given what I've already said about it being a style to me.

Maybe folks are generally more comfortable with sticking to the scope at which tests interact with the system, as @garybernhardt has suggested, rather than they style in which they are written?

@garybernhardt

The percentage of teams writing actual acceptance tests is not very large, as far as I can tell. I certainly don't think that the average Rails team is writing them. If we rename integration/functional/system tests to "acceptance" tests, we recreate exactly the problem that this PR is designed to solve. Instead of confusing Rails programmers about what "unit" means, we'll confuse them about what "acceptance" means.

@stevenharman

@garybernhardt Agreed. I suppose I've not had an adverse reaction due to my own experiences and process wherein I do write acceptance tests.

I'm coming around to the idea keeping with the "scope" of the tests, which while prescriptive, seems less so that any name which also presumes the style of the tests. Does that track?

@blowmage

I'm happy to update the pull request to change "acceptance" and squash the commits, but I feel like there isn't a consensus on a replacement term just yet. Here are the options as I see them:

  • system
  • requests
  • resources

How can we gain a consensus?

@garybernhardt

I'm a fan of simple, established names when available. I call those things integration tests or system tests, and I don't really distinguish between those two types any more. Calling them "request" or "resource" tests doesn't afford communication with other people. If you talk to a J2EE or Django programmer about your resource tests you're going to get a blank stare. ;)

@dvrensk

I take back my +1 for 'requests' since, as @blowmage points out, a single test might contain several requests. For the same reason, I think that 'resource' is a bad idea, but I am still interested in hearing what its proponents have to say.

Out of the three alternatives above, I prefer 'system', and I think it is a good name since the tests exercise the system that I'm building, albeit not necessarily the system of which this project might be a part. If we haven't reached the point of a formal vote, I would like to add another option: "story tests". They do, after all, test stories. But only if you work in stories, of course.

@justinko

Ah, yes, for some reason my brain thought "integration" was taken. I change my vote from "requests" to "integration".

You are running a test that "integrates" parts of the system from the highest level available. Self explanatory.

@stevenharman

You can, of course, integrate at any level. Just hitting an ActiveRecord-backed object is integrating across system boundaries. And testing with any two real (non-stub/mock) objects is integrating across those objects' boundaries.

So... kinda' self explanatory. ;)

@justinko

@stevenharman In the context of testing, "integration" tests hit the other "scopes" (model, controller, etc.). They "integrate" the lower level scopes.

@stevenharman

Sure. I was being pedantic/an arse. The point is, integration can also happen in those other "scopes," and a label that may be applied to many different categories of tests.

Naming is hard. Let's go shopping!

@jeremy
Ruby on Rails member

Historically, functional and integration tests are both controller tests. Their primary differences lie in their APIs, where they hook in to the Rack stack, and how much state they maintain.

Functional tests interact with a bare controller, unencumbered with middleware. You spec out a controller's behavior more intimately, but looking at what exceptions are raised and by which template is rendered. Pretty deep into internal details.

Integration tests interact with the Rack stack using an HTTP API: get '/messages/123' and assert_response :forbidden. The API is built to interact with your HTTP resources and spec out their behavior. They're hands-off when it comes to controller internals.

We'd hoped that the HTTP-oriented integration testing API would eventually take over from the functional testing API, but we haven't really done much to encourage that. The functional testing API works fine, it's easy to think in terms of controller actions rather than URLs, and having access to internals can be convenient. You can go full-on with the integration testing API; never write a functional test. It changes the way you think about what you're testing: the controller vs. the HTTP resource.

Pragmatically speaking, writing tests using the functional API reflects that you're testing the behavior of controller actions. Writing tests using the integration API reflects that you're testing the behavior of HTTP resources.

Barring deprecating and phasing out the functional API entirely, it's sensible to call functional tests "controller" tests and integration tests "resource" tests. We should change the resource generators to prefer resource tests over controller tests, too. Encourage thinking in terms of HTTP interaction rather than controller+action state.

@blowmage

Naming is hard, and time consuming. So I removed the commits relating to the "integration" changes so it won't hold up the changes most seem in favor of. I also squashed the remaining commits.

I still think "integration" is a poor name, and I would like to see it replaced, but we can paint that bike shed in a separate pull request. :)

@jeremy
Ruby on Rails member

Good choice, @blowmage!

@jeremy
Ruby on Rails member

One last thing: could you update the CHANGELOGs as well?

@blowmage blowmage Update test locations
Change the default test locations to avoid confusion around the common
testing terms "unit" and "functional".
Add new rake tasks for the new locations, while maintaining backwards
compatibility with the old rake tasks.

New testing locations are as follows:

    app/models -> test/models (was test/units)
    app/helpers -> test/helpers (was test/units/helpers)
    app/controllers -> test/controllers (was test/functional)
    app/mailers -> test/mailers (was test/functional)
2a68f68
@blowmage

@jeremy CHANGELOGs are updated.

@jeremy jeremy merged commit 1c534c6 into rails:master
@jeremy
Ruby on Rails member

Thanks for seeing this through, @blowmage! :beers:

@spastorino
Ruby on Rails member

@blowmage thanks man!

@steveklabnik
Ruby on Rails member

:shipit: :+1: :heart: :heart: :heart:

@skalnik

Oh my god. YES :metal:

Sounds awesome

@benja83 benja83 referenced this pull request in benja83/toyotakataboard-relational
@benja83 benja83 initial commit, create kata and condition model
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..6a502e9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,16 @@
+# See https://help.github.com/articles/ignoring-files for more about ignoring files.
+#
+# If you find yourself ignoring temporary files generated by your text editor
+# or operating system, you probably want to add a global ignore instead:
+#   git config --global core.excludesfile '~/.gitignore_global'
+
+# Ignore bundler config.
+/.bundle
+
+# Ignore the default SQLite database.
+/db/*.sqlite3
+/db/*.sqlite3-journal
+
+# Ignore all logfiles and tempfiles.
+/log/*.log
+/tmp
diff --git a/.rspec b/.rspec
new file mode 100644
index 0000000..83e16f8
--- /dev/null
+++ b/.rspec
@@ -0,0 +1,2 @@
+--color
+--require spec_helper
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..1176802
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,43 @@
+source 'https://rubygems.org'
+
+
+# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
+gem 'rails', '4.1.0'
+# Use postgresql as the database for Active Record
+gem 'pg'
+# Use SCSS for stylesheets
+gem 'sass-rails', '~> 4.0.3'
+# Use Uglifier as compressor for JavaScript assets
+gem 'uglifier', '>= 1.3.0'
+# Use CoffeeScript for .js.coffee assets and views
+# gem 'coffee-rails', '~> 4.0.0'
+# See https://github.com/sstephenson/execjs#readme for more supported runtimes
+# gem 'therubyracer',  platforms: :ruby
+
+# Use jquery as the JavaScript library
+gem 'jquery-rails'
+# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
+gem 'turbolinks'
+# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
+gem 'jbuilder', '~> 2.0'
+# bundle exec rake doc:rails generates the API under doc/api.
+gem 'sdoc', '~> 0.4.0',          group: :doc
+
+# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
+gem 'spring',        group: :development
+
+# Use ActiveModel has_secure_password
+# gem 'bcrypt', '~> 3.1.7'
+
+# Use unicorn as the app server
+# gem 'unicorn'
+
+# Use Capistrano for deployment
+# gem 'capistrano-rails', group: :development
+
+# Use debugger
+# gem 'debugger', group: [:development, :test]
+
+group :development, :test do
+  gem 'rspec-rails', '~> 3.0'
+end
\ No newline at end of file
diff --git a/Gemfile.lock b/Gemfile.lock
new file mode 100644
index 0000000..9d708c6
--- /dev/null
+++ b/Gemfile.lock
@@ -0,0 +1,143 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    actionmailer (4.1.0)
+      actionpack (= 4.1.0)
+      actionview (= 4.1.0)
+      mail (~> 2.5.4)
+    actionpack (4.1.0)
+      actionview (= 4.1.0)
+      activesupport (= 4.1.0)
+      rack (~> 1.5.2)
+      rack-test (~> 0.6.2)
+    actionview (4.1.0)
+      activesupport (= 4.1.0)
+      builder (~> 3.1)
+      erubis (~> 2.7.0)
+    activemodel (4.1.0)
+      activesupport (= 4.1.0)
+      builder (~> 3.1)
+    activerecord (4.1.0)
+      activemodel (= 4.1.0)
+      activesupport (= 4.1.0)
+      arel (~> 5.0.0)
+    activesupport (4.1.0)
+      i18n (~> 0.6, >= 0.6.9)
+      json (~> 1.7, >= 1.7.7)
+      minitest (~> 5.1)
+      thread_safe (~> 0.1)
+      tzinfo (~> 1.1)
+    arel (5.0.1.20140414130214)
+    builder (3.2.2)
+    coffee-rails (4.1.0)
+      coffee-script (>= 2.2.0)
+      railties (>= 4.0.0, < 5.0)
+    coffee-script (2.4.1)
+      coffee-script-source
+      execjs
+    coffee-script-source (1.9.1.1)
+    diff-lcs (1.2.5)
+    erubis (2.7.0)
+    execjs (2.5.2)
+    hike (1.2.3)
+    i18n (0.7.0)
+    jbuilder (2.2.16)
+      activesupport (>= 3.0.0, < 5)
+      multi_json (~> 1.2)
+    jquery-rails (3.1.2)
+      railties (>= 3.0, < 5.0)
+      thor (>= 0.14, < 2.0)
+    json (1.8.2)
+    mail (2.5.4)
+      mime-types (~> 1.16)
+      treetop (~> 1.4.8)
+    mime-types (1.25.1)
+    minitest (5.6.1)
+    multi_json (1.11.0)
+    pg (0.18.2)
+    polyglot (0.3.5)
+    rack (1.5.3)
+    rack-test (0.6.3)
+      rack (>= 1.0)
+    rails (4.1.0)
+      actionmailer (= 4.1.0)
+      actionpack (= 4.1.0)
+      actionview (= 4.1.0)
+      activemodel (= 4.1.0)
+      activerecord (= 4.1.0)
+      activesupport (= 4.1.0)
+      bundler (>= 1.3.0, < 2.0)
+      railties (= 4.1.0)
+      sprockets-rails (~> 2.0)
+    railties (4.1.0)
+      actionpack (= 4.1.0)
+      activesupport (= 4.1.0)
+      rake (>= 0.8.7)
+      thor (>= 0.18.1, < 2.0)
+    rake (10.4.2)
+    rdoc (4.2.0)
+      json (~> 1.4)
+    rspec-core (3.2.3)
+      rspec-support (~> 3.2.0)
+    rspec-expectations (3.2.1)
+      diff-lcs (>= 1.2.0, < 2.0)
+      rspec-support (~> 3.2.0)
+    rspec-mocks (3.2.1)
+      diff-lcs (>= 1.2.0, < 2.0)
+      rspec-support (~> 3.2.0)
+    rspec-rails (3.2.1)
+      actionpack (>= 3.0, < 4.3)
+      activesupport (>= 3.0, < 4.3)
+      railties (>= 3.0, < 4.3)
+      rspec-core (~> 3.2.0)
+      rspec-expectations (~> 3.2.0)
+      rspec-mocks (~> 3.2.0)
+      rspec-support (~> 3.2.0)
+    rspec-support (3.2.2)
+    sass (3.2.19)
+    sass-rails (4.0.5)
+      railties (>= 4.0.0, < 5.0)
+      sass (~> 3.2.2)
+      sprockets (~> 2.8, < 3.0)
+      sprockets-rails (~> 2.0)
+    sdoc (0.4.1)
+      json (~> 1.7, >= 1.7.7)
+      rdoc (~> 4.0)
+    spring (1.3.6)
+    sprockets (2.12.3)
+      hike (~> 1.2)
+      multi_json (~> 1.0)
+      rack (~> 1.0)
+      tilt (~> 1.1, != 1.3.0)
+    sprockets-rails (2.3.1)
+      actionpack (>= 3.0)
+      activesupport (>= 3.0)
+      sprockets (>= 2.8, < 4.0)
+    thor (0.19.1)
+    thread_safe (0.3.5)
+    tilt (1.4.1)
+    treetop (1.4.15)
+      polyglot
+      polyglot (>= 0.3.1)
+    turbolinks (2.5.3)
+      coffee-rails
+    tzinfo (1.2.2)
+      thread_safe (~> 0.1)
+    uglifier (2.7.1)
+      execjs (>= 0.3.0)
+      json (>= 1.8.0)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  jbuilder (~> 2.0)
+  jquery-rails
+  pg
+  rails (= 4.1.0)
+  rspec-rails (~> 3.0)
+  sass-rails (~> 4.0.3)
+  sdoc (~> 0.4.0)
+  spring
+  turbolinks
+  uglifier (>= 1.3.0)
diff --git a/README.rdoc b/README.rdoc
new file mode 100644
index 0000000..dd4e97e
--- /dev/null
+++ b/README.rdoc
@@ -0,0 +1,28 @@
+== README
+
+This README would normally document whatever steps are necessary to get the
+application up and running.
+
+Things you may want to cover:
+
+* Ruby version
+
+* System dependencies
+
+* Configuration
+
+* Database creation
+
+* Database initialization
+
+* How to run the test suite
+
+* Services (job queues, cache servers, search engines, etc.)
+
+* Deployment instructions
+
+* ...
+
+
+Please feel free to use a different markup language if you do not plan to run
+<tt>rake doc:app</tt>.
diff --git a/Rakefile b/Rakefile
new file mode 100644
index 0000000..ba6b733
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,6 @@
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+
+Rails.application.load_tasks
diff --git a/app/assets/images/.keep b/app/assets/images/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
new file mode 100644
index 0000000..d6925fa
--- /dev/null
+++ b/app/assets/javascripts/application.js
@@ -0,0 +1,16 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// compiled file.
+//
+// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
+// about supported directives.
+//
+//= require jquery
+//= require jquery_ujs
+//= require turbolinks
+//= require_tree .
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
new file mode 100644
index 0000000..a443db3
--- /dev/null
+++ b/app/assets/stylesheets/application.css
@@ -0,0 +1,15 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
+ * compiled file so the styles you add here take precedence over styles defined in any styles
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
+ * file per style scope.
+ *
+ *= require_tree .
+ *= require_self
+ */
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
new file mode 100644
index 0000000..d83690e
--- /dev/null
+++ b/app/controllers/application_controller.rb
@@ -0,0 +1,5 @@
+class ApplicationController < ActionController::Base
+  # Prevent CSRF attacks by raising an exception.
+  # For APIs, you may want to use :null_session instead.
+  protect_from_forgery with: :exception
+end
diff --git a/app/controllers/concerns/.keep b/app/controllers/concerns/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
new file mode 100644
index 0000000..de6be79
--- /dev/null
+++ b/app/helpers/application_helper.rb
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
diff --git a/app/mailers/.keep b/app/mailers/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/app/models/.keep b/app/models/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/app/models/concerns/.keep b/app/models/concerns/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/app/models/condition.rb b/app/models/condition.rb
new file mode 100644
index 0000000..e288628
--- /dev/null
+++ b/app/models/condition.rb
@@ -0,0 +1,3 @@
+class Condition < ActiveRecord::Base
+  belongs_to :kata
+end
diff --git a/app/models/kata.rb b/app/models/kata.rb
new file mode 100644
index 0000000..9fe377a
--- /dev/null
+++ b/app/models/kata.rb
@@ -0,0 +1,3 @@
+class Kata < ActiveRecord::Base
+  has_many :conditions
+end
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
new file mode 100644
index 0000000..c8c3a37
--- /dev/null
+++ b/app/views/layouts/application.html.erb
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>Toyotakataboard</title>
+  <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
+  <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
+  <%= csrf_meta_tags %>
+</head>
+<body>
+
+<%= yield %>
+
+</body>
+</html>
diff --git a/bin/bundle b/bin/bundle
new file mode 100755
index 0000000..66e9889
--- /dev/null
+++ b/bin/bundle
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+load Gem.bin_path('bundler', 'bundle')
diff --git a/bin/rails b/bin/rails
new file mode 100755
index 0000000..728cd85
--- /dev/null
+++ b/bin/rails
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+APP_PATH = File.expand_path('../../config/application',  __FILE__)
+require_relative '../config/boot'
+require 'rails/commands'
diff --git a/bin/rake b/bin/rake
new file mode 100755
index 0000000..1724048
--- /dev/null
+++ b/bin/rake
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+require_relative '../config/boot'
+require 'rake'
+Rake.application.run
diff --git a/config.ru b/config.ru
new file mode 100644
index 0000000..5bc2a61
--- /dev/null
+++ b/config.ru
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment',  __FILE__)
+run Rails.application
diff --git a/config/application.rb b/config/application.rb
new file mode 100644
index 0000000..784b718
--- /dev/null
+++ b/config/application.rb
@@ -0,0 +1,30 @@
+require File.expand_path('../boot', __FILE__)
+
+# Pick the frameworks you want:
+require "active_model/railtie"
+require "active_record/railtie"
+require "action_controller/railtie"
+require "action_mailer/railtie"
+require "action_view/railtie"
+require "sprockets/railtie"
+# require "rails/test_unit/railtie"
+
+# Require the gems listed in Gemfile, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(*Rails.groups)
+
+module Toyotakataboard
+  class Application < Rails::Application
+    # Settings in config/environments/* take precedence over those specified here.
+    # Application configuration should go into files in config/initializers
+    # -- all .rb files in that directory are automatically loaded.
+
+    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
+    # config.time_zone = 'Central Time (US & Canada)'
+
+    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+    # config.i18n.default_locale = :de
+  end
+end
diff --git a/config/boot.rb b/config/boot.rb
new file mode 100644
index 0000000..5e5f0c1
--- /dev/null
+++ b/config/boot.rb
@@ -0,0 +1,4 @@
+# Set up gems listed in the Gemfile.
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+
+require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
diff --git a/config/database.yml b/config/database.yml
new file mode 100644
index 0000000..0ac6612
--- /dev/null
+++ b/config/database.yml
@@ -0,0 +1,85 @@
+# PostgreSQL. Versions 8.2 and up are supported.
+#
+# Install the pg driver:
+#   gem install pg
+# On OS X with Homebrew:
+#   gem install pg -- --with-pg-config=/usr/local/bin/pg_config
+# On OS X with MacPorts:
+#   gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
+# On Windows:
+#   gem install pg
+#       Choose the win32 build.
+#       Install PostgreSQL and put its /bin directory on your path.
+#
+# Configure Using Gemfile
+# gem 'pg'
+#
+default: &default
+  adapter: postgresql
+  encoding: unicode
+  # For details on connection pooling, see rails configuration guide
+  # http://guides.rubyonrails.org/configuring.html#database-pooling
+  pool: 5
+
+development:
+  <<: *default
+  database: toyotakataboard_development
+
+  # The specified database role being used to connect to postgres.
+  # To create additional roles in postgres see `$ createuser --help`.
+  # When left blank, postgres will use the default role. This is
+  # the same name as the operating system user that initialized the database.
+  #username: toyotakataboard
+
+  # The password associated with the postgres role (username).
+  #password:
+
+  # Connect on a TCP socket. Omitted by default since the client uses a
+  # domain socket that doesn't need configuration. Windows does not have
+  # domain sockets, so uncomment these lines.
+  #host: localhost
+
+  # The TCP port the server listens on. Defaults to 5432.
+  # If your server runs on a different port number, change accordingly.
+  #port: 5432
+
+  # Schema search path. The server defaults to $user,public
+  #schema_search_path: myapp,sharedapp,public
+
+  # Minimum log levels, in increasing order:
+  #   debug5, debug4, debug3, debug2, debug1,
+  #   log, notice, warning, error, fatal, and panic
+  # Defaults to warning.
+  #min_messages: notice
+
+# Warning: The database defined as "test" will be erased and
+# re-generated from your development database when you run "rake".
+# Do not set this db to the same as development or production.
+test:
+  <<: *default
+  database: toyotakataboard_test
+
+# As with config/secrets.yml, you never want to store sensitive information,
+# like your database password, in your source code. If your source code is
+# ever seen by anyone, they now have access to your database.
+#
+# Instead, provide the password as a unix environment variable when you boot
+# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
+# for a full rundown on how to provide these environment variables in a
+# production deployment.
+#
+# On Heroku and other platform providers, you may have a full connection URL
+# available as an environment variable. For example:
+#
+#   DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
+#
+# You can use this database configuration with:
+#
+#   production:
+#     url: <%= ENV['DATABASE_URL'] %>
+#
+production:
+  <<: *default
+  database: toyotakataboard_production
+  username: toyotakataboard
+  password: <%= ENV['TOYOTAKATABOARD_DATABASE_PASSWORD'] %>
diff --git a/config/environment.rb b/config/environment.rb
new file mode 100644
index 0000000..ee8d90d
--- /dev/null
+++ b/config/environment.rb
@@ -0,0 +1,5 @@
+# Load the Rails application.
+require File.expand_path('../application', __FILE__)
+
+# Initialize the Rails application.
+Rails.application.initialize!
diff --git a/config/environments/development.rb b/config/environments/development.rb
new file mode 100644
index 0000000..ddf0e90
--- /dev/null
+++ b/config/environments/development.rb
@@ -0,0 +1,37 @@
+Rails.application.configure do
+  # Settings specified here will take precedence over those in config/application.rb.
+
+  # In the development environment your application's code is reloaded on
+  # every request. This slows down response time but is perfect for development
+  # since you don't have to restart the web server when you make code changes.
+  config.cache_classes = false
+
+  # Do not eager load code on boot.
+  config.eager_load = false
+
+  # Show full error reports and disable caching.
+  config.consider_all_requests_local       = true
+  config.action_controller.perform_caching = false
+
+  # Don't care if the mailer can't send.
+  config.action_mailer.raise_delivery_errors = false
+
+  # Print deprecation notices to the Rails logger.
+  config.active_support.deprecation = :log
+
+  # Raise an error on page load if there are pending migrations.
+  config.active_record.migration_error = :page_load
+
+  # Debug mode disables concatenation and preprocessing of assets.
+  # This option may cause significant delays in view rendering with a large
+  # number of complex assets.
+  config.assets.debug = true
+
+  # Adds additional error checking when serving assets at runtime.
+  # Checks for improperly declared sprockets dependencies.
+  # Raises helpful error messages.
+  config.assets.raise_runtime_errors = true
+
+  # Raises error for missing translations
+  # config.action_view.raise_on_missing_translations = true
+end
diff --git a/config/environments/production.rb b/config/environments/production.rb
new file mode 100644
index 0000000..47d3553
--- /dev/null
+++ b/config/environments/production.rb
@@ -0,0 +1,83 @@
+Rails.application.configure do
+  # Settings specified here will take precedence over those in config/application.rb.
+
+  # Code is not reloaded between requests.
+  config.cache_classes = true
+
+  # Eager load code on boot. This eager loads most of Rails and
+  # your application in memory, allowing both threaded web servers
+  # and those relying on copy on write to perform better.
+  # Rake tasks automatically ignore this option for performance.
+  config.eager_load = true
+
+  # Full error reports are disabled and caching is turned on.
+  config.consider_all_requests_local       = false
+  config.action_controller.perform_caching = true
+
+  # Enable Rack::Cache to put a simple HTTP cache in front of your application
+  # Add `rack-cache` to your Gemfile before enabling this.
+  # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
+  # config.action_dispatch.rack_cache = true
+
+  # Disable Rails's static asset server (Apache or nginx will already do this).
+  config.serve_static_assets = false
+
+  # Compress JavaScripts and CSS.
+  config.assets.js_compressor = :uglifier
+  # config.assets.css_compressor = :sass
+
+  # Do not fallback to assets pipeline if a precompiled asset is missed.
+  config.assets.compile = false
+
+  # Generate digests for assets URLs.
+  config.assets.digest = true
+
+  # Version of your assets, change this if you want to expire all your assets.
+  config.assets.version = '1.0'
+
+  # Specifies the header that your server uses for sending files.
+  # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
+  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
+
+  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+  # config.force_ssl = true
+
+  # Set to :debug to see everything in the log.
+  config.log_level = :info
+
+  # Prepend all log lines with the following tags.
+  # config.log_tags = [ :subdomain, :uuid ]
+
+  # Use a different logger for distributed setups.
+  # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
+
+  # Use a different cache store in production.
+  # config.cache_store = :mem_cache_store
+
+  # Enable serving of images, stylesheets, and JavaScripts from an asset server.
+  # config.action_controller.asset_host = "http://assets.example.com"
+
+  # Precompile additional assets.
+  # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
+  # config.assets.precompile += %w( search.js )
+
+  # Ignore bad email addresses and do not raise email delivery errors.
+  # Set this to true and configure the email server for immediate delivery to raise delivery errors.
+  # config.action_mailer.raise_delivery_errors = false
+
+  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+  # the I18n.default_locale when a translation cannot be found).
+  config.i18n.fallbacks = true
+
+  # Send deprecation notices to registered listeners.
+  config.active_support.deprecation = :notify
+
+  # Disable automatic flushing of the log to improve performance.
+  # config.autoflush_log = false
+
+  # Use default logging formatter so that PID and timestamp are not suppressed.
+  config.log_formatter = ::Logger::Formatter.new
+
+  # Do not dump schema after migrations.
+  config.active_record.dump_schema_after_migration = false
+end
diff --git a/config/environments/test.rb b/config/environments/test.rb
new file mode 100644
index 0000000..053f5b6
--- /dev/null
+++ b/config/environments/test.rb
@@ -0,0 +1,39 @@
+Rails.application.configure do
+  # Settings specified here will take precedence over those in config/application.rb.
+
+  # The test environment is used exclusively to run your application's
+  # test suite. You never need to work with it otherwise. Remember that
+  # your test database is "scratch space" for the test suite and is wiped
+  # and recreated between test runs. Don't rely on the data there!
+  config.cache_classes = true
+
+  # Do not eager load code on boot. This avoids loading your whole application
+  # just for the purpose of running a single test. If you are using a tool that
+  # preloads Rails for running tests, you may have to set it to true.
+  config.eager_load = false
+
+  # Configure static asset server for tests with Cache-Control for performance.
+  config.serve_static_assets  = true
+  config.static_cache_control = 'public, max-age=3600'
+
+  # Show full error reports and disable caching.
+  config.consider_all_requests_local       = true
+  config.action_controller.perform_caching = false
+
+  # Raise exceptions instead of rendering exception templates.
+  config.action_dispatch.show_exceptions = false
+
+  # Disable request forgery protection in test environment.
+  config.action_controller.allow_forgery_protection = false
+
+  # Tell Action Mailer not to deliver emails to the real world.
+  # The :test delivery method accumulates sent emails in the
+  # ActionMailer::Base.deliveries array.
+  config.action_mailer.delivery_method = :test
+
+  # Print deprecation notices to the stderr.
+  config.active_support.deprecation = :stderr
+
+  # Raises error for missing translations
+  # config.action_view.raise_on_missing_translations = true
+end
diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb
new file mode 100644
index 0000000..59385cd
--- /dev/null
+++ b/config/initializers/backtrace_silencers.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
+# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb
new file mode 100644
index 0000000..7a06a89
--- /dev/null
+++ b/config/initializers/cookies_serializer.rb
@@ -0,0 +1,3 @@
+# Be sure to restart your server when you modify this file.
+
+Rails.application.config.action_dispatch.cookies_serializer = :json
\ No newline at end of file
diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb
new file mode 100644
index 0000000..4a994e1
--- /dev/null
+++ b/config/initializers/filter_parameter_logging.rb
@@ -0,0 +1,4 @@
+# Be sure to restart your server when you modify this file.
+
+# Configure sensitive parameters which will be filtered from the log file.
+Rails.application.config.filter_parameters += [:password]
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
new file mode 100644
index 0000000..ac033bf
--- /dev/null
+++ b/config/initializers/inflections.rb
@@ -0,0 +1,16 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format. Inflections
+# are locale specific, and you may define rules for as many different
+# locales as you wish. All of these examples are active by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+#   inflect.plural /^(ox)$/i, '\1en'
+#   inflect.singular /^(ox)en/i, '\1'
+#   inflect.irregular 'person', 'people'
+#   inflect.uncountable %w( fish sheep )
+# end
+
+# These inflection rules are supported but not enabled by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+#   inflect.acronym 'RESTful'
+# end
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb
new file mode 100644
index 0000000..dc18996
--- /dev/null
+++ b/config/initializers/mime_types.rb
@@ -0,0 +1,4 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new mime types for use in respond_to blocks:
+# Mime::Type.register "text/richtext", :rtf
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
new file mode 100644
index 0000000..f73ba88
--- /dev/null
+++ b/config/initializers/session_store.rb
@@ -0,0 +1,3 @@
+# Be sure to restart your server when you modify this file.
+
+Rails.application.config.session_store :cookie_store, key: '_toyotakataboard_session'
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb
new file mode 100644
index 0000000..33725e9
--- /dev/null
+++ b/config/initializers/wrap_parameters.rb
@@ -0,0 +1,14 @@
+# Be sure to restart your server when you modify this file.
+
+# This file contains settings for ActionController::ParamsWrapper which
+# is enabled by default.
+
+# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
+ActiveSupport.on_load(:action_controller) do
+  wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
+end
+
+# To enable root element in JSON for ActiveRecord objects.
+# ActiveSupport.on_load(:active_record) do
+#  self.include_root_in_json = true
+# end
diff --git a/config/locales/en.yml b/config/locales/en.yml
new file mode 100644
index 0000000..0653957
--- /dev/null
+++ b/config/locales/en.yml
@@ -0,0 +1,23 @@
+# Files in the config/locales directory are used for internationalization
+# and are automatically loaded by Rails. If you want to use locales other
+# than English, add the necessary files in this directory.
+#
+# To use the locales, use `I18n.t`:
+#
+#     I18n.t 'hello'
+#
+# In views, this is aliased to just `t`:
+#
+#     <%= t('hello') %>
+#
+# To use a different locale, set it with `I18n.locale`:
+#
+#     I18n.locale = :es
+#
+# This would use the information in config/locales/es.yml.
+#
+# To learn more, please read the Rails Internationalization guide
+# available at http://guides.rubyonrails.org/i18n.html.
+
+en:
+  hello: "Hello world"
diff --git a/config/routes.rb b/config/routes.rb
new file mode 100644
index 0000000..3f66539
--- /dev/null
+++ b/config/routes.rb
@@ -0,0 +1,56 @@
+Rails.application.routes.draw do
+  # The priority is based upon order of creation: first created -> highest priority.
+  # See how all your routes lay out with "rake routes".
+
+  # You can have the root of your site routed with "root"
+  # root 'welcome#index'
+
+  # Example of regular route:
+  #   get 'products/:id' => 'catalog#view'
+
+  # Example of named route that can be invoked with purchase_url(id: product.id)
+  #   get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
+
+  # Example resource route (maps HTTP verbs to controller actions automatically):
+  #   resources :products
+
+  # Example resource route with options:
+  #   resources :products do
+  #     member do
+  #       get 'short'
+  #       post 'toggle'
+  #     end
+  #
+  #     collection do
+  #       get 'sold'
+  #     end
+  #   end
+
+  # Example resource route with sub-resources:
+  #   resources :products do
+  #     resources :comments, :sales
+  #     resource :seller
+  #   end
+
+  # Example resource route with more complex sub-resources:
+  #   resources :products do
+  #     resources :comments
+  #     resources :sales do
+  #       get 'recent', on: :collection
+  #     end
+  #   end
+
+  # Example resource route with concerns:
+  #   concern :toggleable do
+  #     post 'toggle'
+  #   end
+  #   resources :posts, concerns: :toggleable
+  #   resources :photos, concerns: :toggleable
+
+  # Example resource route within a namespace:
+  #   namespace :admin do
+  #     # Directs /admin/products/* to Admin::ProductsController
+  #     # (app/controllers/admin/products_controller.rb)
+  #     resources :products
+  #   end
+end
diff --git a/config/secrets.yml b/config/secrets.yml
new file mode 100644
index 0000000..3581cc2
--- /dev/null
+++ b/config/secrets.yml
@@ -0,0 +1,22 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key is used for verifying the integrity of signed cookies.
+# If you change this key, all old signed cookies will become invalid!
+
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+# You can use `rake secret` to generate a secure secret key.
+
+# Make sure the secrets in this file are kept private
+# if you're sharing your code publicly.
+
+development:
+  secret_key_base: 302b3fcb0aa199aec43023bdb6908f5c00c3451fcabb825b33052c910958805752462436ba6725e921d4528068481d1888ddf3a58816b95a2d3cdd4623be22bc
+
+test:
+  secret_key_base: eed3713fdcb5cd2767385f7a9450f13eadd5ca88f125ec5b8fa81198dfa3bae7d0a6c7696c2ea866b982aa9c602e58af09f363de178e569fdb869cfe9f7f4d52
+
+# Do not keep production secrets in the repository,
+# instead read values from the environment.
+production:
+  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
diff --git a/db/migrate/20150524190249_create_kata.rb b/db/migrate/20150524190249_create_kata.rb
new file mode 100644
index 0000000..3da4eb7
--- /dev/null
+++ b/db/migrate/20150524190249_create_kata.rb
@@ -0,0 +1,13 @@
+class CreateKata < ActiveRecord::Migration
+  def change
+    create_table :kata do |t|
+      t.string :name
+      t.string :vision
+      t.string :team
+      t.date :init_date
+      t.date :end_date
+      t.string :responsible
+      t.timestamps
+    end
+  end
+end
diff --git a/db/migrate/20150524192645_create_conditions.rb b/db/migrate/20150524192645_create_conditions.rb
new file mode 100644
index 0000000..d8725f3
--- /dev/null
+++ b/db/migrate/20150524192645_create_conditions.rb
@@ -0,0 +1,10 @@
+class CreateConditions < ActiveRecord::Migration
+  def change
+    create_table :conditions do |t|
+      t.string :title
+      t.string :type
+      t.timestamps
+    end
+    add_reference :conditions, :kata, index: true
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
new file mode 100644
index 0000000..b092856
--- /dev/null
+++ b/db/schema.rb
@@ -0,0 +1,30 @@
+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended that you check this file into your version control system.
+
+ActiveRecord::Schema.define(version: 20150524190249) do
+
+  # These are extensions that must be enabled in order to support this database
+  enable_extension "plpgsql"
+
+  create_table "kata", force: true do |t|
+    t.string   "name"
+    t.string   "vision"
+    t.string   "team"
+    t.date     "init_date"
+    t.date     "end_date"
+    t.string   "responsible"
+    t.datetime "created_at"
+    t.datetime "updated_at"
+  end
+
+end
diff --git a/db/seeds.rb b/db/seeds.rb
new file mode 100644
index 0000000..4edb1e8
--- /dev/null
+++ b/db/seeds.rb
@@ -0,0 +1,7 @@
+# This file should contain all the record creation needed to seed the database with its default values.
+# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
+#
+# Examples:
+#
+#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
+#   Mayor.create(name: 'Emanuel', city: cities.first)
diff --git a/lib/assets/.keep b/lib/assets/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/lib/tasks/.keep b/lib/tasks/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/log/.keep b/log/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/public/404.html b/public/404.html
new file mode 100644
index 0000000..b612547
--- /dev/null
+++ b/public/404.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>The page you were looking for doesn't exist (404)</title>
+  <meta name="viewport" content="width=device-width,initial-scale=1">
+  <style>
+  body {
+    background-color: #EFEFEF;
+    color: #2E2F30;
+    text-align: center;
+    font-family: arial, sans-serif;
+    margin: 0;
+  }
+
+  div.dialog {
+    width: 95%;
+    max-width: 33em;
+    margin: 4em auto 0;
+  }
+
+  div.dialog > div {
+    border: 1px solid #CCC;
+    border-right-color: #999;
+    border-left-color: #999;
+    border-bottom-color: #BBB;
+    border-top: #B00100 solid 4px;
+    border-top-left-radius: 9px;
+    border-top-right-radius: 9px;
+    background-color: white;
+    padding: 7px 12% 0;
+    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
+  }
+
+  h1 {
+    font-size: 100%;
+    color: #730E15;
+    line-height: 1.5em;
+  }
+
+  div.dialog > p {
+    margin: 0 0 1em;
+    padding: 1em;
+    background-color: #F7F7F7;
+    border: 1px solid #CCC;
+    border-right-color: #999;
+    border-left-color: #999;
+    border-bottom-color: #999;
+    border-bottom-left-radius: 4px;
+    border-bottom-right-radius: 4px;
+    border-top-color: #DADADA;
+    color: #666;
+    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
+  }
+  </style>
+</head>
+
+<body>
+  <!-- This file lives in public/404.html -->
+  <div class="dialog">
+    <div>
+      <h1>The page you were looking for doesn't exist.</h1>
+      <p>You may have mistyped the address or the page may have moved.</p>
+    </div>
+    <p>If you are the application owner check the logs for more information.</p>
+  </div>
+</body>
+</html>
diff --git a/public/422.html b/public/422.html
new file mode 100644
index 0000000..a21f82b
--- /dev/null
+++ b/public/422.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>The change you wanted was rejected (422)</title>
+  <meta name="viewport" content="width=device-width,initial-scale=1">
+  <style>
+  body {
+    background-color: #EFEFEF;
+    color: #2E2F30;
+    text-align: center;
+    font-family: arial, sans-serif;
+    margin: 0;
+  }
+
+  div.dialog {
+    width: 95%;
+    max-width: 33em;
+    margin: 4em auto 0;
+  }
+
+  div.dialog > div {
+    border: 1px solid #CCC;
+    border-right-color: #999;
+    border-left-color: #999;
+    border-bottom-color: #BBB;
+    border-top: #B00100 solid 4px;
+    border-top-left-radius: 9px;
+    border-top-right-radius: 9px;
+    background-color: white;
+    padding: 7px 12% 0;
+    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
+  }
+
+  h1 {
+    font-size: 100%;
+    color: #730E15;
+    line-height: 1.5em;
+  }
+
+  div.dialog > p {
+    margin: 0 0 1em;
+    padding: 1em;
+    background-color: #F7F7F7;
+    border: 1px solid #CCC;
+    border-right-color: #999;
+    border-left-color: #999;
+    border-bottom-color: #999;
+    border-bottom-left-radius: 4px;
+    border-bottom-right-radius: 4px;
+    border-top-color: #DADADA;
+    color: #666;
+    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
+  }
+  </style>
+</head>
+
+<body>
+  <!-- This file lives in public/422.html -->
+  <div class="dialog">
+    <div>
+      <h1>The change you wanted was rejected.</h1>
+      <p>Maybe you tried to change something you didn't have access to.</p>
+    </div>
+    <p>If you are the application owner check the logs for more information.</p>
+  </div>
+</body>
+</html>
diff --git a/public/500.html b/public/500.html
new file mode 100644
index 0000000..061abc5
--- /dev/null
+++ b/public/500.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>We're sorry, but something went wrong (500)</title>
+  <meta name="viewport" content="width=device-width,initial-scale=1">
+  <style>
+  body {
+    background-color: #EFEFEF;
+    color: #2E2F30;
+    text-align: center;
+    font-family: arial, sans-serif;
+    margin: 0;
+  }
+
+  div.dialog {
+    width: 95%;
+    max-width: 33em;
+    margin: 4em auto 0;
+  }
+
+  div.dialog > div {
+    border: 1px solid #CCC;
+    border-right-color: #999;
+    border-left-color: #999;
+    border-bottom-color: #BBB;
+    border-top: #B00100 solid 4px;
+    border-top-left-radius: 9px;
+    border-top-right-radius: 9px;
+    background-color: white;
+    padding: 7px 12% 0;
+    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
+  }
+
+  h1 {
+    font-size: 100%;
+    color: #730E15;
+    line-height: 1.5em;
+  }
+
+  div.dialog > p {
+    margin: 0 0 1em;
+    padding: 1em;
+    background-color: #F7F7F7;
+    border: 1px solid #CCC;
+    border-right-color: #999;
+    border-left-color: #999;
+    border-bottom-color: #999;
+    border-bottom-left-radius: 4px;
+    border-bottom-right-radius: 4px;
+    border-top-color: #DADADA;
+    color: #666;
+    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
+  }
+  </style>
+</head>
+
+<body>
+  <!-- This file lives in public/500.html -->
+  <div class="dialog">
+    <div>
+      <h1>We're sorry, but something went wrong.</h1>
+    </div>
+    <p>If you are the application owner check the logs for more information.</p>
+  </div>
+</body>
+</html>
diff --git a/public/favicon.ico b/public/favicon.ico
new file mode 100644
index 0000000..e69de29
diff --git a/public/robots.txt b/public/robots.txt
new file mode 100644
index 0000000..3c9c7c0
--- /dev/null
+++ b/public/robots.txt
@@ -0,0 +1,5 @@
+# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
+#
+# To ban all spiders from the entire site uncomment the next two lines:
+# User-agent: *
+# Disallow: /
diff --git a/spec/models/condition_spec.rb b/spec/models/condition_spec.rb
new file mode 100644
index 0000000..bcf85ec
--- /dev/null
+++ b/spec/models/condition_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe Condition, type: :model do
+  pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/kata_spec.rb b/spec/models/kata_spec.rb
new file mode 100644
index 0000000..e75ae04
--- /dev/null
+++ b/spec/models/kata_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe Kata, type: :model do
+  pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
new file mode 100644
index 0000000..c278035
--- /dev/null
+++ b/spec/rails_helper.rb
@@ -0,0 +1,50 @@
+# This file is copied to spec/ when you run 'rails generate rspec:install'
+ENV['RAILS_ENV'] ||= 'test'
+require 'spec_helper'
+require File.expand_path('../../config/environment', __FILE__)
+require 'rspec/rails'
+# Add additional requires below this line. Rails is not loaded until this point!
+
+# Requires supporting ruby files with custom matchers and macros, etc, in
+# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
+# run as spec files by default. This means that files in spec/support that end
+# in _spec.rb will both be required and run as specs, causing the specs to be
+# run twice. It is recommended that you do not name files matching this glob to
+# end with _spec.rb. You can configure this pattern with the --pattern
+# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
+#
+# The following line is provided for convenience purposes. It has the downside
+# of increasing the boot-up time by auto-requiring all files in the support
+# directory. Alternatively, in the individual `*_spec.rb` files, manually
+# require only the support files necessary.
+#
+# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
+
+# Checks for pending migrations before tests are run.
+# If you are not using ActiveRecord, you can remove this line.
+ActiveRecord::Migration.maintain_test_schema!
+
+RSpec.configure do |config|
+  # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
+  config.fixture_path = "#{::Rails.root}/spec/fixtures"
+
+  # If you're not using ActiveRecord, or you'd prefer not to run each of your
+  # examples within a transaction, remove the following line or assign false
+  # instead of true.
+  config.use_transactional_fixtures = true
+
+  # RSpec Rails can automatically mix in different behaviours to your tests
+  # based on their file location, for example enabling you to call `get` and
+  # `post` in specs under `spec/controllers`.
+  #
+  # You can disable this behaviour by removing the line below, and instead
+  # explicitly tag your specs with their type, e.g.:
+  #
+  #     RSpec.describe UsersController, :type => :controller do
+  #       # ...
+  #     end
+  #
+  # The different available types are documented in the features, such as in
+  # https://relishapp.com/rspec/rspec-rails/docs
+  config.infer_spec_type_from_file_location!
+end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
new file mode 100644
index 0000000..38a4f9a
--- /dev/null
+++ b/spec/spec_helper.rb
@@ -0,0 +1,87 @@
+# This file was generated by the `rails generate rspec:install` command. Conventionally, all
+# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
+# The generated `.rspec` file contains `--require spec_helper` which will cause
+# this file to always be loaded, without a need to explicitly require it in any
+# files.
+#
+# Given that it is always loaded, you are encouraged to keep this file as
+# light-weight as possible. Requiring heavyweight dependencies from this file
+# will add to the boot time of your test suite on EVERY test run, even for an
+# individual file that may not need all of that loaded. Instead, consider making
+# a separate helper file that requires the additional dependencies and performs
+# the additional setup, and require it from the spec files that actually need
+# it.
+#
+# The `.rspec` file also contains a few flags that are not defaults but that
+# users commonly want.
+#
+# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
+RSpec.configure do |config|
+  # rspec-expectations config goes here. You can use an alternate
+  # assertion/expectation library such as wrong or the stdlib/minitest
+  # assertions if you prefer.
+  config.expect_with :rspec do |expectations|
+    # This option will default to `true` in RSpec 4. It makes the `description`
+    # and `failure_message` of custom matchers include text for helper methods
+    # defined using `chain`, e.g.:
+    #     be_bigger_than(2).and_smaller_than(4).description
+    #     # => "be bigger than 2 and smaller than 4"
+    # ...rather than:
+    #     # => "be bigger than 2"
+    expectations.include_chain_clauses_in_custom_matcher_descriptions = true
+  end
+
+  # rspec-mocks config goes here. You can use an alternate test double
+  # library (such as bogus or mocha) by changing the `mock_with` option here.
+  config.mock_with :rspec do |mocks|
+    # Prevents you from mocking or stubbing a method that does not exist on
+    # a real object. This is generally recommended, and will default to
+    # `true` in RSpec 4.
+    mocks.verify_partial_doubles = true
+  end
+
+# The settings below are suggested to provide a good initial experience
+# with RSpec, but feel free to customize to your heart's content.
+=begin
+  # These two settings work together to allow you to limit a spec run
+  # to individual examples or groups you care about by tagging them with
+  # `:focus` metadata. When nothing is tagged with `:focus`, all examples
+  # get run.
+  config.filter_run :focus
+  config.run_all_when_everything_filtered = true
+
+  # Limits the available syntax to the non-monkey patched syntax that is
+  # recommended. For more details, see:
+  #   - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
+  #   - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
+  #   - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
+  config.disable_monkey_patching!
+
+  # Many RSpec users commonly either run the entire suite or an individual
+  # file, and it's useful to allow more verbose output when running an
+  # individual spec file.
+  if config.files_to_run.one?
+    # Use the documentation formatter for detailed output,
+    # unless a formatter has already been configured
+    # (e.g. via a command-line flag).
+    config.default_formatter = 'doc'
+  end
+
+  # Print the 10 slowest examples and example groups at the
+  # end of the spec run, to help surface which specs are running
+  # particularly slow.
+  config.profile_examples = 10
+
+  # Run specs in random order to surface order dependencies. If you find an
+  # order dependency and want to debug it, you can fix the order by providing
+  # the seed, which is printed after each run.
+  #     --seed 1234
+  config.order = :random
+
+  # Seed global randomization in this process using the `--seed` CLI option.
+  # Setting this allows you to use `--seed` to deterministically reproduce
+  # test failures related to randomization by passing the same `--seed` value
+  # as the one that triggered the failure.
+  Kernel.srand config.seed
+=end
+end
diff --git a/vendor/assets/javascripts/.keep b/vendor/assets/javascripts/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/vendor/assets/stylesheets/.keep b/vendor/assets/stylesheets/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/vendor/bundle/ruby/2.1.0/bin/erubis b/vendor/bundle/ruby/2.1.0/bin/erubis
new file mode 100755
index 0000000..301dd30
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/erubis
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'erubis' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'erubis', version
+load Gem.bin_path('erubis', 'erubis', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/htmldiff b/vendor/bundle/ruby/2.1.0/bin/htmldiff
new file mode 100755
index 0000000..6829c46
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/htmldiff
@@ -0,0 +1,25 @@
+#!/bin/sh
+'exec' "ruby" '-x' "$0" "$@"
+#!/Users/benjamintarenne/.rvm/rubies/ruby-2.1.1/bin/ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'diff-lcs' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'diff-lcs', version
+load Gem.bin_path('diff-lcs', 'htmldiff', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/ldiff b/vendor/bundle/ruby/2.1.0/bin/ldiff
new file mode 100755
index 0000000..5d8588a
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/ldiff
@@ -0,0 +1,25 @@
+#!/bin/sh
+'exec' "ruby" '-x' "$0" "$@"
+#!/Users/benjamintarenne/.rvm/rubies/ruby-2.1.1/bin/ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'diff-lcs' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'diff-lcs', version
+load Gem.bin_path('diff-lcs', 'ldiff', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/rackup b/vendor/bundle/ruby/2.1.0/bin/rackup
new file mode 100755
index 0000000..416d30a
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/rackup
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'rack' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'rack', version
+load Gem.bin_path('rack', 'rackup', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/rails b/vendor/bundle/ruby/2.1.0/bin/rails
new file mode 100755
index 0000000..b2a661f
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/rails
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'railties' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'railties', version
+load Gem.bin_path('railties', 'rails', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/rake b/vendor/bundle/ruby/2.1.0/bin/rake
new file mode 100755
index 0000000..97d1fcc
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/rake
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'rake' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'rake', version
+load Gem.bin_path('rake', 'rake', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/rdoc b/vendor/bundle/ruby/2.1.0/bin/rdoc
new file mode 100755
index 0000000..0d3d314
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/rdoc
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'rdoc' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'rdoc', version
+load Gem.bin_path('rdoc', 'rdoc', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/ri b/vendor/bundle/ruby/2.1.0/bin/ri
new file mode 100755
index 0000000..cf45350
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/ri
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'rdoc' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'rdoc', version
+load Gem.bin_path('rdoc', 'ri', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/rspec b/vendor/bundle/ruby/2.1.0/bin/rspec
new file mode 100755
index 0000000..1df29e9
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/rspec
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'rspec-core' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'rspec-core', version
+load Gem.bin_path('rspec-core', 'rspec', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/sass b/vendor/bundle/ruby/2.1.0/bin/sass
new file mode 100755
index 0000000..2ade46c
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/sass
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'sass' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'sass', version
+load Gem.bin_path('sass', 'sass', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/sass-convert b/vendor/bundle/ruby/2.1.0/bin/sass-convert
new file mode 100755
index 0000000..2c1393c
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/sass-convert
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'sass' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'sass', version
+load Gem.bin_path('sass', 'sass-convert', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/scss b/vendor/bundle/ruby/2.1.0/bin/scss
new file mode 100755
index 0000000..6be603a
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/scss
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'sass' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'sass', version
+load Gem.bin_path('sass', 'scss', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/sdoc b/vendor/bundle/ruby/2.1.0/bin/sdoc
new file mode 100755
index 0000000..b28fa10
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/sdoc
@@ -0,0 +1,25 @@
+#!/bin/sh
+'exec' "ruby" '-x' "$0" "$@"
+#!/Users/benjamintarenne/.rvm/rubies/ruby-2.1.1/bin/ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'sdoc' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'sdoc', version
+load Gem.bin_path('sdoc', 'sdoc', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/sdoc-merge b/vendor/bundle/ruby/2.1.0/bin/sdoc-merge
new file mode 100755
index 0000000..a836cc7
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/sdoc-merge
@@ -0,0 +1,25 @@
+#!/bin/sh
+'exec' "ruby" '-x' "$0" "$@"
+#!/Users/benjamintarenne/.rvm/rubies/ruby-2.1.1/bin/ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'sdoc' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'sdoc', version
+load Gem.bin_path('sdoc', 'sdoc-merge', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/spring b/vendor/bundle/ruby/2.1.0/bin/spring
new file mode 100755
index 0000000..49623b8
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/spring
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'spring' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'spring', version
+load Gem.bin_path('spring', 'spring', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/sprockets b/vendor/bundle/ruby/2.1.0/bin/sprockets
new file mode 100755
index 0000000..bb01742
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/sprockets
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'sprockets' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'sprockets', version
+load Gem.bin_path('sprockets', 'sprockets', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/thor b/vendor/bundle/ruby/2.1.0/bin/thor
new file mode 100755
index 0000000..2533f7b
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/thor
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'thor' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'thor', version
+load Gem.bin_path('thor', 'thor', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/tilt b/vendor/bundle/ruby/2.1.0/bin/tilt
new file mode 100755
index 0000000..cba5196
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/tilt
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'tilt' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'tilt', version
+load Gem.bin_path('tilt', 'tilt', version)
diff --git a/vendor/bundle/ruby/2.1.0/bin/tt b/vendor/bundle/ruby/2.1.0/bin/tt
new file mode 100755
index 0000000..34efa1b
--- /dev/null
+++ b/vendor/bundle/ruby/2.1.0/bin/tt
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'treetop' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first
+  str = ARGV.first
+  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
+  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
+    version = $1
+    ARGV.shift
+  end
+end
+
+gem 'treetop', version
+load Gem.bin_path('treetop', 'tt', version)
diff --git a/vendor/bundle/ruby/2.1.0/cache/actionmailer-4.1.0.gem b/vendor/bundle/ruby/2.1.0/cache/actionmailer-4.1.0.gem
new file mode 100644
index 0000000..9e518e7
Binary files /dev/null and b/vendor/bundle/ruby/2.1.0/cache/actionmailer-4.1.0.gem differ
diff --git a/vendor/bundle/ruby/2.1.0/cache/actionpack-4.1.0.gem b/vendor/bundle/ruby/2.1.0/cache/actionpack-4.1.0.gem
new file mode 100644
index 0000000..1e70691
Binary files /dev/null and b/vendor/bundle/ruby/2.1.0/cache/actionpack-4.1.0.gem differ
diff --git a/vendor/bundle/ruby/2.1.0/cache/actionview-4.1.0.gem b/vendor/bundle/ruby/2.1.0/cache/actionview-4.1.0.gem
new file mode 100644
index 0000000..af9fb87
Binary files /dev/null and b/vendor/bundle/ruby/2.1.0/cache/actionview-4.1.0.gem differ
diff --git a/vendor/bundle/ruby/2.1.0/cache/activemodel-4.1.0.gem b/vendor/bundle/ruby/2.1.0/cache/activemodel-4.1.0.gem
new file mode 100644
index 0000000..3f961d6
Binary files /dev/null and b/vendor/bundle/ruby/2.1.0/cache/activemodel-4.1.0.gem differ
diff --git a/vendor/bundle/ruby/2.1.0/cache/activerecord-4.1.0.gem b/vendor/bundle/ruby/2.1.0/cache/activerecord-4.1.0.gem
new file mode 100644
index 0000000..c624bbb
Binary files /dev/null and b/vendor/bundle/ruby/2.1.0/cache/activerecord-4.1.0.gem differ
diff --git a/vendor/bundle/ruby/2.1.0/cache/activesupport-4.1.0.gem b/vendor/bundle/ruby/2.1.0/cache/activesupport-4.1.0.gem
new file mode 100644
index 0000000..c9b221c
Binary files /dev/null and b/vendor/bundle/ruby/2.1.0/cache/activesupport-4.1.0.gem differ
diff --git a/vendor/bundle/ruby/2.1.0/cache/arel-5.0.1.20140414130214.gem b/vendor/bundle/ruby/2.1.0/cache/arel-5.0.1.20140414130214.gem
new file mode 100644
index 0000000..5200b6f
Binary files /dev/null and b/vendor/bundle/ruby/2.1.0/cache/arel-5.0.1.20140414130214.gem differ
diff --git a/vendor/bundle/ruby/2.1.0/cache/builder-3.2.2.gem b/vendor/bundle/ruby/2.1.0/cache/builder-3.2.2.gem
new file mode 100644
index 0000000..b59ef92
Binary files /dev/null and b/vendor/bundle/ruby/2.1.0/cache/builder-3.2.2.gem differ
diff --git a/vendor/bundle/ruby/2.1.0/cache/coffee-rails-4.1.0.gem b/vendor/bundle/ruby/2.1.0/cache/coffee-rails-4.1.0.gem
new file mode 100644
index 0000000..7477588
Binary files /dev/null and b/vendor/bundle/ruby/2.1.0/cache/coffee-rails-4.1.0.gem differ
diff --git a/vendor/bundle/ruby/2.1.0/cache/coffee-script-2.4.1.gem b/vendor/bundle/ruby/2.1.0/cache/coffee-script-2.4.1.gem
new file mode 100644
index 0000000..7e4066d
Binary files /dev/null and b/vendor/bundle/ruby/2.1.0/cache/coffee-script-2.4.1.gem differ
diff --git a/vendor/bundle/ruby/2.1.0/cache/coffee-script-source-1.9.1.1.gem b/vendor/bundle/ruby/2.1.0/cache/coffee-script-source-1.9.1.1.gem
new file mode 100644
index 0000000..5c27695
Binary files /dev/null and b/vendor/bundle/ruby/2.1.0/cache/coffee-script-source-1.9.1.1.gem differ
diff --git a/vendor/bundle/ruby/2.1.0/cache/diff-lcs-1.2.5.gem b/vendor/bundle/ruby/2.1.0/cache/diff-lcs-1.2.5.gem
new file mode 100644
index 0000000..e4436cc
Binary files /dev/null and b/vendor/bundle/ruby/2.1.0/cache/diff-lcs-1.2.5.gem diffe…
a53f3de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 9, 2012
  1. @blowmage

    Update test locations

    blowmage committed
    Change the default test locations to avoid confusion around the common
    testing terms "unit" and "functional".
    Add new rake tasks for the new locations, while maintaining backwards
    compatibility with the old rake tasks.
    
    New testing locations are as follows:
    
        app/models -> test/models (was test/units)
        app/helpers -> test/helpers (was test/units/helpers)
        app/controllers -> test/controllers (was test/functional)
        app/mailers -> test/mailers (was test/functional)
Showing with 187 additions and 146 deletions.
  1. +1 −1 actionmailer/lib/rails/generators/mailer/USAGE
  2. +2 −0 guides/CHANGELOG.md
  3. +1 −1 guides/source/action_mailer_basics.md
  4. +11 −11 guides/source/command_line.md
  5. +9 −9 guides/source/engines.md
  6. +6 −6 guides/source/generators.md
  7. +12 −12 guides/source/getting_started.md
  8. +17 −13 guides/source/testing.md
  9. +3 −0 railties/CHANGELOG.md
  10. +4 −2 railties/lib/rails/generators/rails/app/app_generator.rb
  11. +4 −4 railties/lib/rails/generators/rails/controller/USAGE
  12. +1 −1 railties/lib/rails/generators/rails/helper/USAGE
  13. +2 −2 railties/lib/rails/generators/rails/model/USAGE
  14. +1 −1 railties/lib/rails/generators/rails/observer/USAGE
  15. +4 −4 railties/lib/rails/generators/rails/scaffold_controller/USAGE
  16. +1 −1 railties/lib/rails/generators/test_unit/controller/controller_generator.rb
  17. +1 −1 railties/lib/rails/generators/test_unit/helper/helper_generator.rb
  18. +1 −1 railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb
  19. +1 −1 railties/lib/rails/generators/test_unit/model/model_generator.rb
  20. +1 −1 railties/lib/rails/generators/test_unit/observer/observer_generator.rb
  21. +1 −1 railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb
  22. +6 −2 railties/lib/rails/tasks/statistics.rake
  23. +30 −6 railties/lib/rails/test_unit/testing.rake
  24. +6 −6 railties/test/application/rake_test.rb
  25. +4 −2 railties/test/generators/app_generator_test.rb
  26. +4 −4 railties/test/generators/controller_generator_test.rb
  27. +1 −1 railties/test/generators/helper_generator_test.rb
  28. +1 −1 railties/test/generators/mailer_generator_test.rb
  29. +3 −3 railties/test/generators/model_generator_test.rb
  30. +25 −25 railties/test/generators/namespaced_generators_test.rb
  31. +1 −1 railties/test/generators/observer_generator_test.rb
  32. +5 −5 railties/test/generators/resource_generator_test.rb
  33. +4 −4 railties/test/generators/scaffold_controller_generator_test.rb
  34. +13 −13 railties/test/generators/scaffold_generator_test.rb
View
2 actionmailer/lib/rails/generators/mailer/USAGE
@@ -13,6 +13,6 @@ Example:
creates a Notifications mailer class, views, test, and fixtures:
Mailer: app/mailers/notifications.rb
Views: app/views/notifications/signup.erb [...]
- Test: test/functional/notifications_test.rb
+ Test: test/mailers/notifications_test.rb
Fixtures: test/fixtures/notifications/signup [...]
View
2 guides/CHANGELOG.md
@@ -1,3 +1,5 @@
## Rails 4.0.0 (unreleased) ##
+* Guides updated to reflect new test locations. *Mike Moore*
+
* Guides have a responsive design. *Joe Fiorini*
View
2 guides/source/action_mailer_basics.md
@@ -27,7 +27,7 @@ create app/mailers/user_mailer.rb
invoke erb
create app/views/user_mailer
invoke test_unit
-create test/functional/user_mailer_test.rb
+create test/mailers/user_mailer_test.rb
```
So we got the mailer, the views, and the tests.
View
22 guides/source/command_line.md
@@ -134,10 +134,10 @@ Example:
`rails generate controller CreditCard open debit credit close`
Credit card controller with URLs like /credit_card/debit.
- Controller: app/controllers/credit_card_controller.rb
- Functional Test: test/functional/credit_card_controller_test.rb
- Views: app/views/credit_card/debit.html.erb [...]
- Helper: app/helpers/credit_card_helper.rb
+ Controller: app/controllers/credit_card_controller.rb
+ Test: test/controllers/credit_card_controller_test.rb
+ Views: app/views/credit_card/debit.html.erb [...]
+ Helper: app/helpers/credit_card_helper.rb
```
The controller generator is expecting parameters in the form of `generate controller ControllerName action1 action2`. Let's make a `Greetings` controller with an action of **hello**, which will say something nice to us.
@@ -150,11 +150,11 @@ $ rails generate controller Greetings hello
create app/views/greetings
create app/views/greetings/hello.html.erb
invoke test_unit
- create test/functional/greetings_controller_test.rb
+ create test/controllers/greetings_controller_test.rb
invoke helper
create app/helpers/greetings_helper.rb
invoke test_unit
- create test/unit/helpers/greetings_helper_test.rb
+ create test/helpers/greetings_helper_test.rb
invoke assets
invoke coffee
create app/assets/javascripts/greetings.js.coffee
@@ -223,7 +223,7 @@ $ rails generate scaffold HighScore game:string score:integer
create db/migrate/20120528060026_create_high_scores.rb
create app/models/high_score.rb
invoke test_unit
- create test/unit/high_score_test.rb
+ create test/models/high_score_test.rb
create test/fixtures/high_scores.yml
route resources :high_scores
invoke scaffold_controller
@@ -236,11 +236,11 @@ $ rails generate scaffold HighScore game:string score:integer
create app/views/high_scores/new.html.erb
create app/views/high_scores/_form.html.erb
invoke test_unit
- create test/functional/high_scores_controller_test.rb
+ create test/controllers/high_scores_controller_test.rb
invoke helper
create app/helpers/high_scores_helper.rb
invoke test_unit
- create test/unit/helpers/high_scores_helper_test.rb
+ create test/helpers/high_scores_helper_test.rb
invoke assets
invoke coffee
create app/assets/javascripts/high_scores.js.coffee
@@ -327,7 +327,7 @@ $ rails generate model Oops
create db/migrate/20120528062523_create_oops.rb
create app/models/oops.rb
invoke test_unit
- create test/unit/oops_test.rb
+ create test/models/oops_test.rb
create test/fixtures/oops.yml
```
```bash
@@ -336,7 +336,7 @@ $ rails destroy model Oops
remove db/migrate/20120528062523_create_oops.rb
remove app/models/oops.rb
invoke test_unit
- remove test/unit/oops_test.rb
+ remove test/models/oops_test.rb
remove test/fixtures/oops.yml
```
View
18 guides/source/engines.md
@@ -130,7 +130,7 @@ end
This line mounts the engine at the path `/blorgh`, which will make it accessible through the application only at that path.
-Also in the test directory is the `test/integration` directory, where integration tests for the engine should be placed. Other directories can be created in the `test` directory also. For example, you may wish to create a `test/unit` directory for your unit tests.
+Also in the test directory is the `test/integration` directory, where integration tests for the engine should be placed. Other directories can be created in the `test` directory also. For example, you may wish to create a `test/models` directory for your models tests.
Providing engine functionality
------------------------------
@@ -152,7 +152,7 @@ invoke active_record
create db/migrate/[timestamp]_create_blorgh_posts.rb
create app/models/blorgh/post.rb
invoke test_unit
-create test/unit/blorgh/post_test.rb
+create test/models/blorgh/post_test.rb
create test/fixtures/blorgh/posts.yml
route resources :posts
invoke scaffold_controller
@@ -165,11 +165,11 @@ create app/views/blorgh/posts/show.html.erb
create app/views/blorgh/posts/new.html.erb
create app/views/blorgh/posts/_form.html.erb
invoke test_unit
-create test/functional/blorgh/posts_controller_test.rb
+create test/controllers/blorgh/posts_controller_test.rb
invoke helper
create app/helpers/blorgh/posts_helper.rb
invoke test_unit
-create test/unit/helpers/blorgh/posts_helper_test.rb
+create test/helpers/blorgh/posts_helper_test.rb
invoke assets
invoke js
create app/assets/javascripts/blorgh/posts.js
@@ -181,7 +181,7 @@ create app/assets/stylesheets/scaffold.css
The first thing that the scaffold generator does is invoke the `active_record` generator, which generates a migration and a model for the resource. Note here, however, that the migration is called `create_blorgh_posts` rather than the usual `create_posts`. This is due to the `isolate_namespace` method called in the `Blorgh::Engine` class's definition. The model here is also namespaced, being placed at `app/models/blorgh/post.rb` rather than `app/models/post.rb` due to the `isolate_namespace` call within the `Engine` class.
-Next, the `test_unit` generator is invoked for this model, generating a unit test at `test/unit/blorgh/post_test.rb` (rather than `test/unit/post_test.rb`) and a fixture at `test/fixtures/blorgh/posts.yml` (rather than `test/fixtures/posts.yml`).
+Next, the `test_unit` generator is invoked for this model, generating a model test at `test/models/blorgh/post_test.rb` (rather than `test/models/post_test.rb`) and a fixture at `test/fixtures/blorgh/posts.yml` (rather than `test/fixtures/posts.yml`).
After that, a line for the resource is inserted into the `config/routes.rb` file for the engine. This line is simply `resources :posts`, turning the `config/routes.rb` file for the engine into this:
@@ -193,7 +193,7 @@ end
Note here that the routes are drawn upon the `Blorgh::Engine` object rather than the `YourApp::Application` class. This is so that the engine routes are confined to the engine itself and can be mounted at a specific point as shown in the [test directory](#test-directory) section. This is also what causes the engine's routes to be isolated from those routes that are within the application. This is discussed further in the [Routes](#routes) section of this guide.
-Next, the `scaffold_controller` generator is invoked, generating a controller called `Blorgh::PostsController` (at `app/controllers/blorgh/posts_controller.rb`) and its related views at `app/views/blorgh/posts`. This generator also generates a functional test for the controller (`test/functional/blorgh/posts_controller_test.rb`) and a helper (`app/helpers/blorgh/posts_controller.rb`).
+Next, the `scaffold_controller` generator is invoked, generating a controller called `Blorgh::PostsController` (at `app/controllers/blorgh/posts_controller.rb`) and its related views at `app/views/blorgh/posts`. This generator also generates a test for the controller (`test/controllers/blorgh/posts_controller_test.rb`) and a helper (`app/helpers/blorgh/posts_controller.rb`).
Everything this generator has created is neatly namespaced. The controller's class is defined within the `Blorgh` module:
@@ -261,7 +261,7 @@ invoke active_record
create db/migrate/[timestamp]_create_blorgh_comments.rb
create app/models/blorgh/comment.rb
invoke test_unit
-create test/unit/blorgh/comment_test.rb
+create test/models/blorgh/comment_test.rb
create test/fixtures/blorgh/comments.yml
```
@@ -334,11 +334,11 @@ create app/controllers/blorgh/comments_controller.rb
invoke erb
exist app/views/blorgh/comments
invoke test_unit
-create test/functional/blorgh/comments_controller_test.rb
+create test/controllers/blorgh/comments_controller_test.rb
invoke helper
create app/helpers/blorgh/comments_helper.rb
invoke test_unit
-create test/unit/helpers/blorgh/comments_helper_test.rb
+create test/helpers/blorgh/comments_helper_test.rb
invoke assets
invoke js
create app/assets/javascripts/blorgh/comments.js
View
12 guides/source/generators.md
@@ -176,7 +176,7 @@ $ rails generate scaffold User name:string
create db/migrate/20091120125558_create_users.rb
create app/models/user.rb
invoke test_unit
- create test/unit/user_test.rb
+ create test/models/user_test.rb
create test/fixtures/users.yml
route resources :users
invoke scaffold_controller
@@ -189,11 +189,11 @@ $ rails generate scaffold User name:string
create app/views/users/new.html.erb
create app/views/users/_form.html.erb
invoke test_unit
- create test/functional/users_controller_test.rb
+ create test/controllers/users_controller_test.rb
invoke helper
create app/helpers/users_helper.rb
invoke test_unit
- create test/unit/helpers/users_helper_test.rb
+ create test/helpers/users_helper_test.rb
invoke stylesheets
create app/assets/stylesheets/scaffold.css
```
@@ -350,7 +350,7 @@ $ rails generate scaffold Comment body:text
create db/migrate/20091120151323_create_comments.rb
create app/models/comment.rb
invoke shoulda
- create test/unit/comment_test.rb
+ create test/models/comment_test.rb
create test/fixtures/comments.yml
route resources :comments
invoke scaffold_controller
@@ -364,11 +364,11 @@ $ rails generate scaffold Comment body:text
create app/views/comments/_form.html.erb
create app/views/layouts/comments.html.erb
invoke shoulda
- create test/functional/comments_controller_test.rb
+ create test/controllers/comments_controller_test.rb
invoke my_helper
create app/helpers/comments_helper.rb
invoke shoulda
- create test/unit/helpers/comments_helper_test.rb
+ create test/helpers/comments_helper_test.rb
```
Fallbacks allow your generators to have a single responsibility, increasing code reuse and reducing the amount of duplication.
View
24 guides/source/getting_started.md
@@ -185,11 +185,11 @@ invoke erb
create app/views/welcome
create app/views/welcome/index.html.erb
invoke test_unit
-create test/functional/welcome_controller_test.rb
+create test/controllers/welcome_controller_test.rb
invoke helper
create app/helpers/welcome_helper.rb
invoke test_unit
-create test/unit/helpers/welcome_helper_test.rb
+create test/helpers/welcome_helper_test.rb
invoke assets
invoke coffee
create app/assets/javascripts/welcome.js.coffee
@@ -1239,7 +1239,7 @@ This command will generate four files:
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| db/migrate/20100207235629_create_comments.rb | Migration to create the comments table in your database (your name will include a different timestamp) |
| app/models/comment.rb | The Comment model |
-| test/unit/comment_test.rb | Unit testing harness for the comments model |
+| test/models/comment_test.rb | Testing harness for the comments model |
| test/fixtures/comments.yml | Sample comments for use in testing |
First, take a look at `comment.rb`:
@@ -1360,15 +1360,15 @@ $ rails generate controller Comments
This creates six files and one empty directory:
-| File/Directory | Purpose |
-| ------------------------------------------- | ---------------------------------------- |
-| app/controllers/comments_controller.rb | The Comments controller |
-| app/views/comments/ | Views of the controller are stored here |
-| test/functional/comments_controller_test.rb | The functional tests for the controller |
-| app/helpers/comments_helper.rb | A view helper file |
-| test/unit/helpers/comments_helper_test.rb | The unit tests for the helper |
-| app/assets/javascripts/comment.js.coffee | CoffeeScript for the controller |
-| app/assets/stylesheets/comment.css.scss | Cascading style sheet for the controller |
+| File/Directory | Purpose |
+| -------------------------------------------- | ---------------------------------------- |
+| app/controllers/comments_controller.rb | The Comments controller |
+| app/views/comments/ | Views of the controller are stored here |
+| test/controllers/comments_controller_test.rb | The test for the controller |
+| app/helpers/comments_helper.rb | A view helper file |
+| test/helpers/comments_helper_test.rb | The test for the helper |
+| app/assets/javascripts/comment.js.coffee | CoffeeScript for the controller |
+| app/assets/stylesheets/comment.css.scss | Cascading style sheet for the controller |
Like with any blog, our readers will create their comments directly after
reading the post, and once they have added their comment, will be sent back to
View
30 guides/source/testing.md
@@ -121,18 +121,18 @@ For this guide we will be using Rails _scaffolding_. It will create the model, a
NOTE: For more information on Rails <i>scaffolding</i>, refer to [Getting Started with Rails](getting_started.html)
-When you use `rails generate scaffold`, for a resource among other things it creates a test stub in the `test/unit` folder:
+When you use `rails generate scaffold`, for a resource among other things it creates a test stub in the `test/models` folder:
```bash
$ rails generate scaffold post title:string body:text
...
create app/models/post.rb
-create test/unit/post_test.rb
+create test/models/post_test.rb
create test/fixtures/posts.yml
...
```
-The default test stub in `test/unit/post_test.rb` looks like this:
+The default test stub in `test/models/post_test.rb` looks like this:
```ruby
require 'test_helper'
@@ -225,9 +225,9 @@ TIP: You can see all these rake tasks and their descriptions by running `rake --
Running a test is as simple as invoking the file containing the test cases through Ruby:
```bash
-$ ruby -Itest test/unit/post_test.rb
+$ ruby -Itest test/models/post_test.rb
-Loaded suite unit/post_test
+Loaded suite models/post_test
Started
.
Finished in 0.023513 seconds.
@@ -240,9 +240,9 @@ This will run all the test methods from the test case. Note that `test_helper.rb
You can also run a particular test method from the test case by using the `-n` switch with the `test method name`.
```bash
-$ ruby -Itest test/unit/post_test.rb -n test_the_truth
+$ ruby -Itest test/models/post_test.rb -n test_the_truth
-Loaded suite unit/post_test
+Loaded suite models/post_test
Started
.
Finished in 0.023513 seconds.
@@ -271,7 +271,7 @@ F
Finished in 0.102072 seconds.
1) Failure:
-test_should_not_save_post_without_title(PostTest) [/test/unit/post_test.rb:6]:
+test_should_not_save_post_without_title(PostTest) [/test/models/post_test.rb:6]:
<false> is not true.
1 tests, 1 assertions, 1 failures, 0 errors
@@ -290,7 +290,7 @@ Running this test shows the friendlier assertion message:
```bash
1) Failure:
-test_should_not_save_post_without_title(PostTest) [/test/unit/post_test.rb:6]:
+test_should_not_save_post_without_title(PostTest) [/test/models/post_test.rb:6]:
Saved the post without a title.
<false> is not true.
```
@@ -341,7 +341,7 @@ Finished in 0.082603 seconds.
1) Error:
test_should_report_error(PostTest):
NameError: undefined local variable or method `some_undefined_variable' for #<PostTest:0x249d354>
- /test/unit/post_test.rb:6:in `test_should_report_error'
+ /test/models/post_test.rb:6:in `test_should_report_error'
1 tests, 0 assertions, 0 failures, 1 errors
```
@@ -420,7 +420,7 @@ You should test for things such as:
* was the correct object stored in the response template?
* was the appropriate message displayed to the user in the view?
-Now that we have used Rails scaffold generator for our `Post` resource, it has already created the controller code and functional tests. You can take look at the file `posts_controller_test.rb` in the `test/functional` directory.
+Now that we have used Rails scaffold generator for our `Post` resource, it has already created the controller code and tests. You can take look at the file `posts_controller_test.rb` in the `test/controllers` directory.
Let me take you through one such test, `test_should_get_index` from the file `posts_controller_test.rb`.
@@ -762,12 +762,16 @@ You don't need to set up and run your tests by hand on a test-by-test basis. Rai
| ------------------------------- | ----------- |
| `rake test` | Runs all unit, functional and integration tests. You can also simply run `rake` as the _test_ target is the default.|
| `rake test:benchmark` | Benchmark the performance tests|
-| `rake test:functionals` | Runs all the functional tests from `test/functional`|
+| `rake test:controllers` | Runs all the controller tests from `test/controllers`|
+| `rake test:functionals` | Runs all the functional tests from `test/controllers`, `test/mailers`, and `test/functional`|
+| `rake test:helpers` | Runs all the helper tests from `test/helpers`|
| `rake test:integration` | Runs all the integration tests from `test/integration`|
+| `rake test:mailers` | Runs all the mailer tests from `test/mailers`|
+| `rake test:models` | Runs all the model tests from `test/models`|
| `rake test:profile` | Profile the performance tests|
| `rake test:recent` | Tests recent changes|
| `rake test:uncommitted` | Runs all the tests which are uncommitted. Supports Subversion and Git|
-| `rake test:units` | Runs all the unit tests from `test/unit`|
+| `rake test:units` | Runs all the unit tests from `test/models`, `test/helpers`, and `test/unit`|
Brief Note About `Test::Unit`
View
3 railties/CHANGELOG.md
@@ -1,5 +1,8 @@
## Rails 4.0.0 (unreleased) ##
+* New test locations `test/models`, `test/helpers`, `test/controllers`, and
+ `test/mailers`. Corresponding rake tasks added as well. *Mike Moore*
+
* Set a different cache per environment for assets pipeline
through `config.assets.cache`.
View
6 railties/lib/rails/generators/rails/app/app_generator.rb
@@ -113,9 +113,11 @@ def script
def test
empty_directory_with_keep_file 'test/fixtures'
- empty_directory_with_keep_file 'test/functional'
+ empty_directory_with_keep_file 'test/controllers'
+ empty_directory_with_keep_file 'test/mailers'
+ empty_directory_with_keep_file 'test/models'
+ empty_directory_with_keep_file 'test/helpers'
empty_directory_with_keep_file 'test/integration'
- empty_directory_with_keep_file 'test/unit'
template 'test/performance/browsing_test.rb'
template 'test/test_helper.rb'
View
8 railties/lib/rails/generators/rails/controller/USAGE
@@ -12,7 +12,7 @@ Example:
`rails generate controller CreditCards open debit credit close`
CreditCards controller with URLs like /credit_cards/debit.
- Controller: app/controllers/credit_cards_controller.rb
- Functional Test: test/functional/credit_cards_controller_test.rb
- Views: app/views/credit_cards/debit.html.erb [...]
- Helper: app/helpers/credit_cards_helper.rb
+ Controller: app/controllers/credit_cards_controller.rb
+ Test: test/controllers/credit_cards_controller_test.rb
+ Views: app/views/credit_cards/debit.html.erb [...]
+ Helper: app/helpers/credit_cards_helper.rb
View
2 railties/lib/rails/generators/rails/helper/USAGE
@@ -13,5 +13,5 @@ Example:
Credit card helper.
Helper: app/helpers/credit_card_helper.rb
- Test: test/unit/helpers/credit_card_helper_test.rb
+ Test: test/helpers/credit_card_helper_test.rb
View
4 railties/lib/rails/generators/rails/model/USAGE
@@ -74,7 +74,7 @@ Examples:
For ActiveRecord and TestUnit it creates:
Model: app/models/account.rb
- Test: test/unit/account_test.rb
+ Test: test/models/account_test.rb
Fixtures: test/fixtures/accounts.yml
Migration: db/migrate/XXX_add_accounts.rb
@@ -88,7 +88,7 @@ Examples:
Module: app/models/admin.rb
Model: app/models/admin/account.rb
- Test: test/unit/admin/account_test.rb
+ Test: test/models/admin/account_test.rb
Fixtures: test/fixtures/admin/accounts.yml
Migration: db/migrate/XXX_add_admin_accounts.rb
View
2 railties/lib/rails/generators/rails/observer/USAGE
@@ -9,4 +9,4 @@ Example:
For ActiveRecord and TestUnit it creates:
Observer: app/models/account_observer.rb
- TestUnit: test/unit/account_observer_test.rb
+ TestUnit: test/models/account_observer_test.rb
View
8 railties/lib/rails/generators/rails/scaffold_controller/USAGE
@@ -13,7 +13,7 @@ Example:
`rails generate scaffold_controller CreditCard`
Credit card controller with URLs like /credit_card/debit.
- Controller: app/controllers/credit_cards_controller.rb
- Functional Test: test/functional/credit_cards_controller_test.rb
- Views: app/views/credit_cards/index.html.erb [...]
- Helper: app/helpers/credit_cards_helper.rb
+ Controller: app/controllers/credit_cards_controller.rb
+ Test: test/controllers/credit_cards_controller_test.rb
+ Views: app/views/credit_cards/index.html.erb [...]
+ Helper: app/helpers/credit_cards_helper.rb
View
2 railties/lib/rails/generators/test_unit/controller/controller_generator.rb
@@ -8,7 +8,7 @@ class ControllerGenerator < Base
def create_test_files
template 'functional_test.rb',
- File.join('test/functional', class_path, "#{file_name}_controller_test.rb")
+ File.join('test/controllers', class_path, "#{file_name}_controller_test.rb")
end
end
end
View
2 railties/lib/rails/generators/test_unit/helper/helper_generator.rb
@@ -6,7 +6,7 @@ class HelperGenerator < Base
check_class_collision :suffix => "HelperTest"
def create_helper_files
- template 'helper_test.rb', File.join('test/unit/helpers', class_path, "#{file_name}_helper_test.rb")
+ template 'helper_test.rb', File.join('test/helpers', class_path, "#{file_name}_helper_test.rb")
end
end
end
View
2 railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb
@@ -7,7 +7,7 @@ class MailerGenerator < Base
check_class_collision :suffix => "Test"
def create_test_files
- template "functional_test.rb", File.join('test/functional', class_path, "#{file_name}_test.rb")
+ template "functional_test.rb", File.join('test/mailers', class_path, "#{file_name}_test.rb")
end
end
end
View
2 railties/lib/rails/generators/test_unit/model/model_generator.rb
@@ -9,7 +9,7 @@ class ModelGenerator < Base
check_class_collision :suffix => "Test"
def create_test_file
- template 'unit_test.rb', File.join('test/unit', class_path, "#{file_name}_test.rb")
+ template 'unit_test.rb', File.join('test/models', class_path, "#{file_name}_test.rb")
end
hook_for :fixture_replacement
View
2 railties/lib/rails/generators/test_unit/observer/observer_generator.rb
@@ -6,7 +6,7 @@ class ObserverGenerator < Base
check_class_collision :suffix => "ObserverTest"
def create_test_files
- template 'unit_test.rb', File.join('test/unit', class_path, "#{file_name}_observer_test.rb")
+ template 'unit_test.rb', File.join('test/models', class_path, "#{file_name}_observer_test.rb")
end
end
end
View
2 railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb
@@ -12,7 +12,7 @@ class ScaffoldGenerator < Base
def create_test_files
template "functional_test.rb",
- File.join("test/functional", controller_class_path, "#{controller_file_name}_controller_test.rb")
+ File.join("test/controllers", controller_class_path, "#{controller_file_name}_controller_test.rb")
end
private
View
8 railties/lib/rails/tasks/statistics.rake
@@ -6,9 +6,13 @@ STATS_DIRECTORIES = [
%w(Javascripts app/assets/javascripts),
%w(Libraries lib/),
%w(APIs app/apis),
+ %w(Controller\ tests test/controllers),
+ %w(Helper\ tests test/helpers),
+ %w(Model\ tests test/models),
+ %w(Mailer\ tests test/mailers),
%w(Integration\ tests test/integration),
- %w(Functional\ tests test/functional),
- %w(Unit\ tests test/unit)
+ %w(Functional\ tests\ (old) test/functional),
+ %w(Unit\ tests \ (old) test/unit)
].collect { |name, dir| [ name, "#{Rails.root}/#{dir}" ] }.select { |name, dir| File.directory?(dir) }
desc "Report code statistics (KLOCs, etc) from the application"
View
36 railties/lib/rails/test_unit/testing.rake
@@ -15,11 +15,11 @@ def recent_tests(source_pattern, test_path, touched_since = 10.minutes.ago)
# Support subdirs in app/models and app/controllers
modified_test_path = source_dir.length > 2 ? "#{test_path}/" << source_dir[1..source_dir.length].join('/') : test_path
- # For modified files in app/ run the tests for it. ex. /test/functional/account_controller.rb
+ # For modified files in app/ run the tests for it. ex. /test/controllers/account_controller.rb
test = "#{modified_test_path}/#{source_file}_test.rb"
tests.push test if File.exist?(test)
- # For modified files in app, run tests in subdirs too. ex. /test/functional/account/*_test.rb
+ # For modified files in app, run tests in subdirs too. ex. /test/controllers/account/*_test.rb
test = "#{modified_test_path}/#{File.basename(path, '.rb').sub("_controller","")}"
FileList["#{test}/*_test.rb"].each { |f| tests.push f } if File.exist?(test)
@@ -74,7 +74,9 @@ namespace :test do
Rake::TestTask.new(:recent => "test:prepare") do |t|
since = TEST_CHANGES_SINCE
touched = FileList['test/**/*_test.rb'].select { |path| File.mtime(path) > since } +
+ recent_tests('app/models/**/*.rb', 'test/models', since) +
recent_tests('app/models/**/*.rb', 'test/unit', since) +
+ recent_tests('app/controllers/**/*.rb', 'test/controllers', since) +
recent_tests('app/controllers/**/*.rb', 'test/functional', since)
t.libs << 'test'
@@ -95,8 +97,10 @@ namespace :test do
models = changed_since_checkin.select { |path| path =~ /app[\\\/]models[\\\/].*\.rb$/ }
controllers = changed_since_checkin.select { |path| path =~ /app[\\\/]controllers[\\\/].*\.rb$/ }
- unit_tests = models.map { |model| "test/unit/#{File.basename(model, '.rb')}_test.rb" }
- functional_tests = controllers.map { |controller| "test/functional/#{File.basename(controller, '.rb')}_test.rb" }
+ unit_tests = models.map { |model| "test/models/#{File.basename(model, '.rb')}_test.rb" } +
+ models.map { |model| "test/unit/#{File.basename(model, '.rb')}_test.rb" } +
+ functional_tests = controllers.map { |controller| "test/controllers/#{File.basename(controller, '.rb')}_test.rb" } +
+ controllers.map { |controller| "test/functional/#{File.basename(controller, '.rb')}_test.rb" }
(unit_tests + functional_tests).uniq.select { |file| File.exist?(file) }
end
@@ -108,14 +112,34 @@ namespace :test do
t.libs << "test"
end
+ Rails::SubTestTask.new(:models => "test:prepare") do |t|
+ t.libs << "test"
+ t.pattern = 'test/models/**/*_test.rb'
+ end
+
+ Rails::SubTestTask.new(:helpers => "test:prepare") do |t|
+ t.libs << "test"
+ t.pattern = 'test/helpers/**/*_test.rb'
+ end
+
Rails::SubTestTask.new(:units => "test:prepare") do |t|
t.libs << "test"
- t.pattern = 'test/unit/**/*_test.rb'
+ t.pattern = 'test/{models,helpers,unit}/**/*_test.rb'
+ end
+
+ Rails::SubTestTask.new(:controllers => "test:prepare") do |t|
+ t.libs << "test"
+ t.pattern = 'test/controllers/**/*_test.rb'
+ end
+
+ Rails::SubTestTask.new(:mailers => "test:prepare") do |t|
+ t.libs << "test"
+ t.pattern = 'test/mailers/**/*_test.rb'
end
Rails::SubTestTask.new(:functionals => "test:prepare") do |t|
t.libs << "test"
- t.pattern = 'test/functional/**/*_test.rb'
+ t.pattern = 'test/{controllers,mailers,functional}/**/*_test.rb'
end
Rails::SubTestTask.new(:integration => "test:prepare") do |t|
View
12 railties/test/application/rake_test.rb
@@ -86,12 +86,12 @@ def test_code_statistics_sanity
def test_rake_test_error_output
Dir.chdir(app_path){ `rake db:migrate` }
- app_file "test/unit/one_unit_test.rb", <<-RUBY
- raise 'unit'
+ app_file "test/models/one_model_test.rb", <<-RUBY
+ raise 'models'
RUBY
- app_file "test/functional/one_functional_test.rb", <<-RUBY
- raise 'functional'
+ app_file "test/controllers/one_controller_test.rb", <<-RUBY
+ raise 'controllers'
RUBY
app_file "test/integration/one_integration_test.rb", <<-RUBY
@@ -100,8 +100,8 @@ def test_rake_test_error_output
silence_stderr do
output = Dir.chdir(app_path) { `rake test 2>&1` }
- assert_match 'unit', output
- assert_match 'functional', output
+ assert_match 'models', output
+ assert_match 'controllers', output
assert_match 'integration', output
end
end
View
6 railties/test/generators/app_generator_test.rb
@@ -26,10 +26,12 @@
log
script/rails
test/fixtures
- test/functional
+ test/controllers
+ test/models
+ test/helpers
+ test/mailers
test/integration
test/performance
- test/unit
vendor
vendor/assets
tmp/cache
View
8 railties/test/generators/controller_generator_test.rb
@@ -28,13 +28,13 @@ def test_check_class_collision
def test_invokes_helper
run_generator
assert_file "app/helpers/account_helper.rb"
- assert_file "test/unit/helpers/account_helper_test.rb"
+ assert_file "test/helpers/account_helper_test.rb"
end
def test_does_not_invoke_helper_if_required
run_generator ["account", "--skip-helper"]
assert_no_file "app/helpers/account_helper.rb"
- assert_no_file "test/unit/helpers/account_helper_test.rb"
+ assert_no_file "test/helpers/account_helper_test.rb"
end
def test_invokes_assets
@@ -45,12 +45,12 @@ def test_invokes_assets
def test_invokes_default_test_framework
run_generator
- assert_file "test/functional/account_controller_test.rb"
+ assert_file "test/controllers/account_controller_test.rb"
end
def test_does_not_invoke_test_framework_if_required
run_generator ["account", "--no-test-framework"]
- assert_no_file "test/functional/account_controller_test.rb"
+ assert_no_file "test/controllers/account_controller_test.rb"
end
def test_invokes_default_template_engine
View
2 railties/test/generators/helper_generator_test.rb
@@ -15,7 +15,7 @@ def test_helper_skeleton_is_created
def test_invokes_default_test_framework
run_generator
- assert_file "test/unit/helpers/admin_helper_test.rb", /class AdminHelperTest < ActionView::TestCase/
+ assert_file "test/helpers/admin_helper_test.rb", /class AdminHelperTest < ActionView::TestCase/
end
def test_logs_if_the_test_framework_cannot_be_found
View
2 railties/test/generators/mailer_generator_test.rb
@@ -29,7 +29,7 @@ def test_check_class_collision
def test_invokes_default_test_framework
run_generator
- assert_file "test/functional/notifier_test.rb" do |test|
+ assert_file "test/mailers/notifier_test.rb" do |test|
assert_match(/class NotifierTest < ActionMailer::TestCase/, test)
assert_match(/test "foo"/, test)
assert_match(/test "bar"/, test)
View
6 railties/test/generators/model_generator_test.rb
@@ -157,7 +157,7 @@ def test_migration_with_missing_attribute_type_and_with_index
assert_match(/create_table :products/, up)
assert_match(/t\.string :name/, up)
assert_match(/t\.integer :supplier_id/, up)
-
+
assert_match(/add_index :products, :name/, up)
assert_match(/add_index :products, :supplier_id/, up)
assert_no_match(/add_index :products, :year/, up)
@@ -181,7 +181,7 @@ def test_add_migration_with_attributes_index_declaration_and_attribute_options
assert_match(/add_index :products, :discount, unique: true/, content)
end
end
-
+
def test_migration_without_timestamps
ActiveRecord::Base.timestamped_migrations = false
run_generator ["account"]
@@ -269,7 +269,7 @@ def test_existing_migration_is_removed_on_force
def test_invokes_default_test_framework
run_generator
- assert_file "test/unit/account_test.rb", /class AccountTest < ActiveSupport::TestCase/
+ assert_file "test/models/account_test.rb", /class AccountTest < ActiveSupport::TestCase/
assert_file "test/fixtures/accounts.yml", /name: MyString/, /age: 1/
end
View
50 railties/test/generators/namespaced_generators_test.rb
@@ -25,7 +25,7 @@ def test_namespaced_controller_skeleton_is_created
/module TestApp/,
/ class AccountController < ApplicationController/
- assert_file "test/functional/test_app/account_controller_test.rb",
+ assert_file "test/controllers/test_app/account_controller_test.rb",
/module TestApp/,
/ class AccountControllerTest/
end
@@ -46,12 +46,12 @@ def test_namespaced_controller_with_additional_namespace
def test_helpr_is_also_namespaced
run_generator
assert_file "app/helpers/test_app/account_helper.rb", /module TestApp/, / module AccountHelper/
- assert_file "test/unit/helpers/test_app/account_helper_test.rb", /module TestApp/, / class AccountHelperTest/
+ assert_file "test/helpers/test_app/account_helper_test.rb", /module TestApp/, / class AccountHelperTest/
end
def test_invokes_default_test_framework
run_generator
- assert_file "test/functional/test_app/account_controller_test.rb"
+ assert_file "test/controllers/test_app/account_controller_test.rb"
end
def test_invokes_default_template_engine
@@ -136,7 +136,7 @@ def test_migration_with_nested_namespace_without_pluralization
def test_invokes_default_test_framework
run_generator
- assert_file "test/unit/test_app/account_test.rb", /module TestApp/, /class AccountTest < ActiveSupport::TestCase/
+ assert_file "test/models/test_app/account_test.rb", /module TestApp/, /class AccountTest < ActiveSupport::TestCase/
assert_file "test/fixtures/test_app/accounts.yml", /name: MyString/, /age: 1/
end
end
@@ -158,7 +158,7 @@ def test_invokes_default_orm_with_class_path
def test_invokes_default_test_framework
run_generator
- assert_file "test/unit/test_app/account_observer_test.rb", /module TestApp/, / class AccountObserverTest < ActiveSupport::TestCase/
+ assert_file "test/models/test_app/account_observer_test.rb", /module TestApp/, / class AccountObserverTest < ActiveSupport::TestCase/
end
end
@@ -186,7 +186,7 @@ def test_mailer_with_i18n_helper
def test_invokes_default_test_framework
run_generator
- assert_file "test/functional/test_app/notifier_test.rb" do |test|
+ assert_file "test/mailers/test_app/notifier_test.rb" do |test|
assert_match(/module TestApp/, test)
assert_match(/class NotifierTest < ActionMailer::TestCase/, test)
assert_match(/test "foo"/, test)
@@ -225,7 +225,7 @@ def test_scaffold_on_invoke
# Model
assert_file "app/models/test_app/product_line.rb", /module TestApp\n class ProductLine < ActiveRecord::Base/
- assert_file "test/unit/test_app/product_line_test.rb", /module TestApp\n class ProductLineTest < ActiveSupport::TestCase/
+ assert_file "test/models/test_app/product_line_test.rb", /module TestApp\n class ProductLineTest < ActiveSupport::TestCase/
assert_file "test/fixtures/test_app/product_lines.yml"
assert_migration "db/migrate/create_test_app_product_lines.rb"
@@ -240,7 +240,7 @@ def test_scaffold_on_invoke
/module TestApp/,
/class ProductLinesController < ApplicationController/
- assert_file "test/functional/test_app/product_lines_controller_test.rb",
+ assert_file "test/controllers/test_app/product_lines_controller_test.rb",
/module TestApp\n class ProductLinesControllerTest < ActionController::TestCase/
# Views
@@ -255,7 +255,7 @@ def test_scaffold_on_invoke
# Helpers
assert_file "app/helpers/test_app/product_lines_helper.rb"
- assert_file "test/unit/helpers/test_app/product_lines_helper_test.rb"
+ assert_file "test/helpers/test_app/product_lines_helper_test.rb"
# Stylesheets
assert_file "app/assets/stylesheets/scaffold.css"
@@ -267,7 +267,7 @@ def test_scaffold_on_revoke
# Model
assert_no_file "app/models/test_app/product_line.rb"
- assert_no_file "test/unit/test_app/product_line_test.rb"
+ assert_no_file "test/models/test_app/product_line_test.rb"
assert_no_file "test/fixtures/test_app/product_lines.yml"
assert_no_migration "db/migrate/create_test_app_product_lines.rb"
@@ -278,7 +278,7 @@ def test_scaffold_on_revoke
# Controller
assert_no_file "app/controllers/test_app/product_lines_controller.rb"
- assert_no_file "test/functional/test_app/product_lines_controller_test.rb"
+ assert_no_file "test/controllers/test_app/product_lines_controller_test.rb"
# Views
assert_no_file "app/views/test_app/product_lines"
@@ -286,7 +286,7 @@ def test_scaffold_on_revoke
# Helpers
assert_no_file "app/helpers/test_app/product_lines_helper.rb"
- assert_no_file "test/unit/helpers/test_app/product_lines_helper_test.rb"
+ assert_no_file "test/helpers/test_app/product_lines_helper_test.rb"
# Stylesheets (should not be removed)
assert_file "app/assets/stylesheets/scaffold.css"
@@ -298,7 +298,7 @@ def test_scaffold_with_namespace_on_invoke
# Model
assert_file "app/models/test_app/admin.rb", /module TestApp\n module Admin/
assert_file "app/models/test_app/admin/role.rb", /module TestApp\n class Admin::Role < ActiveRecord::Base/
- assert_file "test/unit/test_app/admin/role_test.rb", /module TestApp\n class Admin::RoleTest < ActiveSupport::TestCase/
+ assert_file "test/models/test_app/admin/role_test.rb", /module TestApp\n class Admin::RoleTest < ActiveSupport::TestCase/
assert_file "test/fixtures/test_app/admin/roles.yml"
assert_migration "db/migrate/create_test_app_admin_roles.rb"
@@ -312,7 +312,7 @@ def test_scaffold_with_namespace_on_invoke
assert_match(/module TestApp\n class Admin::RolesController < ApplicationController/, content)
end
- assert_file "test/functional/test_app/admin/roles_controller_test.rb",
+ assert_file "test/controllers/test_app/admin/roles_controller_test.rb",
/module TestApp\n class Admin::RolesControllerTest < ActionController::TestCase/
# Views
@@ -327,7 +327,7 @@ def test_scaffold_with_namespace_on_invoke
# Helpers
assert_file "app/helpers/test_app/admin/roles_helper.rb"
- assert_file "test/unit/helpers/test_app/admin/roles_helper_test.rb"
+ assert_file "test/helpers/test_app/admin/roles_helper_test.rb"
# Stylesheets
assert_file "app/assets/stylesheets/scaffold.css"
@@ -340,7 +340,7 @@ def test_scaffold_with_namespace_on_revoke
# Model
assert_file "app/models/test_app/admin.rb" # ( should not be remove )
assert_no_file "app/models/test_app/admin/role.rb"
- assert_no_file "test/unit/test_app/admin/role_test.rb"
+ assert_no_file "test/models/test_app/admin/role_test.rb"
assert_no_file "test/fixtures/test_app/admin/roles.yml"
assert_no_migration "db/migrate/create_test_app_admin_roles.rb"
@@ -351,7 +351,7 @@ def test_scaffold_with_namespace_on_revoke
# Controller
assert_no_file "app/controllers/test_app/admin/roles_controller.rb"
- assert_no_file "test/functional/test_app/admin/roles_controller_test.rb"
+ assert_no_file "test/controllers/test_app/admin/roles_controller_test.rb"
# Views
assert_no_file "app/views/test_app/admin/roles"
@@ -359,19 +359,19 @@ def test_scaffold_with_namespace_on_revoke
# Helpers
assert_no_file "app/helpers/test_app/admin/roles_helper.rb"
- assert_no_file "test/unit/helpers/test_app/admin/roles_helper_test.rb"
+ assert_no_file "test/helpers/test_app/admin/roles_helper_test.rb"
# Stylesheets (should not be removed)
assert_file "app/assets/stylesheets/scaffold.css"
end
-
+
def test_scaffold_with_nested_namespace_on_invoke
run_generator [ "admin/user/special/role", "name:string", "description:string" ]
# Model
assert_file "app/models/test_app/admin/user/special.rb", /module TestApp\n module Admin/
assert_file "app/models/test_app/admin/user/special/role.rb", /module TestApp\n class Admin::User::Special::Role < ActiveRecord::Base/
- assert_file "test/unit/test_app/admin/user/special/role_test.rb", /module TestApp\n class Admin::User::Special::RoleTest < ActiveSupport::TestCase/
+ assert_file "test/models/test_app/admin/user/special/role_test.rb", /module TestApp\n class Admin::User::Special::RoleTest < ActiveSupport::TestCase/
assert_file "test/fixtures/test_app/admin/user/special/roles.yml"
assert_migration "db/migrate/create_test_app_admin_user_special_roles.rb"
@@ -385,7 +385,7 @@ def test_scaffold_with_nested_namespace_on_invoke
assert_match(/module TestApp\n class Admin::User::Special::RolesController < ApplicationController/, content)
end
- assert_file "test/functional/test_app/admin/user/special/roles_controller_test.rb",
+ assert_file "test/controllers/test_app/admin/user/special/roles_controller_test.rb",
/module TestApp\n class Admin::User::Special::RolesControllerTest < ActionController::TestCase/
# Views
@@ -400,7 +400,7 @@ def test_scaffold_with_nested_namespace_on_invoke
# Helpers
assert_file "app/helpers/test_app/admin/user/special/roles_helper.rb"
- assert_file "test/unit/helpers/test_app/admin/user/special/roles_helper_test.rb"
+ assert_file "test/helpers/test_app/admin/user/special/roles_helper_test.rb"
# Stylesheets
assert_file "app/assets/stylesheets/scaffold.css"
@@ -413,7 +413,7 @@ def test_scaffold_with_nested_namespace_on_revoke
# Model
assert_file "app/models/test_app/admin/user/special.rb" # ( should not be remove )
assert_no_file "app/models/test_app/admin/user/special/role.rb"
- assert_no_file "test/unit/test_app/admin/user/special/role_test.rb"
+ assert_no_file "test/models/test_app/admin/user/special/role_test.rb"
assert_no_file "test/fixtures/test_app/admin/user/special/roles.yml"
assert_no_migration "db/migrate/create_test_app_admin_user_special_roles.rb"
@@ -424,14 +424,14 @@ def test_scaffold_with_nested_namespace_on_revoke
# Controller
assert_no_file "app/controllers/test_app/admin/user/special/roles_controller.rb"
- assert_no_file "test/functional/test_app/admin/user/special/roles_controller_test.rb"
+ assert_no_file "test/controllers/test_app/admin/user/special/roles_controller_test.rb"
# Views
assert_no_file "app/views/test_app/admin/user/special/roles"
# Helpers
assert_no_file "app/helpers/test_app/admin/user/special/roles_helper.rb"
- assert_no_file "test/unit/helpers/test_app/admin/user/special/roles_helper_test.rb"
+ assert_no_file "test/helpers/test_app/admin/user/special/roles_helper_test.rb"
# Stylesheets (should not be removed)
assert_file "app/assets/stylesheets/scaffold.css"
View
2 railties/test/generators/observer_generator_test.rb
@@ -17,7 +17,7 @@ def test_invokes_default_orm_with_class_path
def test_invokes_default_test_framework
run_generator
- assert_file "test/unit/account_observer_test.rb", /class AccountObserverTest < ActiveSupport::TestCase/
+ assert_file "test/models/account_observer_test.rb", /class AccountObserverTest < ActiveSupport::TestCase/
end
def test_logs_if_the_test_framework_cannot_be_found
View
10 railties/test/generators/resource_generator_test.rb
@@ -18,7 +18,7 @@ def test_files_from_inherited_invocation
%w(
app/models/account.rb
- test/unit/account_test.rb
+ test/models/account_test.rb
test/fixtures/accounts.yml
).each { |path| assert_file path }
@@ -33,10 +33,10 @@ def test_inherited_invocations_with_attributes
def test_resource_controller_with_pluralized_class_name
run_generator
assert_file "app/controllers/accounts_controller.rb", /class AccountsController < ApplicationController/
- assert_file "test/functional/accounts_controller_test.rb", /class AccountsControllerTest < ActionController::TestCase/
+ assert_file "test/controllers/accounts_controller_test.rb", /class AccountsControllerTest < ActionController::TestCase/
assert_file "app/helpers/accounts_helper.rb", /module AccountsHelper/
- assert_file "test/unit/helpers/accounts_helper_test.rb", /class AccountsHelperTest < ActionView::TestCase/
+ assert_file "test/helpers/accounts_helper_test.rb", /class AccountsHelperTest < ActionView::TestCase/
end
def test_resource_controller_with_actions
@@ -62,14 +62,14 @@ def test_resource_routes_are_added
def test_plural_names_are_singularized
content = run_generator ["accounts".freeze]
assert_file "app/models/account.rb", /class Account < ActiveRecord::Base/
- assert_file "test/unit/account_test.rb", /class AccountTest/
+ assert_file "test/models/account_test.rb", /class AccountTest/
assert_match(/Plural version of the model detected, using singularized version. Override with --force-plural./, content)
end
def test_plural_names_can_be_forced
content = run_generator ["accounts", "--force-plural"]
assert_file "app/models/accounts.rb", /class Accounts < ActiveRecord::Base/
- assert_file "test/unit/accounts_test.rb", /class AccountsTest/
+ assert_file "test/models/accounts_test.rb", /class AccountsTest/
assert_no_match(/Plural version of the model detected/, content)
end
View
8 railties/test/generators/scaffold_controller_generator_test.rb
@@ -57,7 +57,7 @@ def test_controller_skeleton_is_created
def test_helper_are_invoked_with_a_pluralized_name
run_generator
assert_file "app/helpers/users_helper.rb", /module UsersHelper/
- assert_file "test/unit/helpers/users_helper_test.rb", /class UsersHelperTest < ActionView::TestCase/
+ assert_file "test/helpers/users_helper_test.rb", /class UsersHelperTest < ActionView::TestCase/
end
def test_views_are_generated
@@ -75,7 +75,7 @@ def test_views_are_generated
def test_functional_tests
run_generator
- assert_file "test/functional/users_controller_test.rb" do |content|
+ assert_file "test/controllers/users_controller_test.rb" do |content|
assert_match(/class UsersControllerTest < ActionController::TestCase/, content)
assert_match(/test "should get index"/, content)
assert_match(/post :create, user: \{ age: @user.age, name: @user.name \}/, content)
@@ -86,7 +86,7 @@ def test_functional_tests
def test_functional_tests_without_attributes
run_generator ["User"]
- assert_file "test/functional/users_controller_test.rb" do |content|
+ assert_file "test/controllers/users_controller_test.rb" do |content|
assert_match(/class UsersControllerTest < ActionController::TestCase/, content)
assert_match(/test "should get index"/, content)
assert_match(/post :create, user: \{ \}/, content)
@@ -97,7 +97,7 @@ def test_functional_tests_without_attributes
def test_skip_helper_if_required
run_generator ["User", "name:string", "age:integer", "--no-helper"]
assert_no_file "app/helpers/users_helper.rb"
- assert_no_file "test/unit/helpers/users_helper_test.rb"
+ assert_no_file "test/helpers/users_helper_test.rb"
end
def test_skip_layout_if_required
View
26 railties/test/generators/scaffold_generator_test.rb
@@ -12,7 +12,7 @@ def test_scaffold_on_invoke
# Model
assert_file "app/models/product_line.rb", /class ProductLine < ActiveRecord::Base/
- assert_file "test/unit/product_line_test.rb", /class ProductLineTest < ActiveSupport::TestCase/
+ assert_file "test/models/product_line_test.rb", /class ProductLineTest < ActiveSupport::TestCase/
assert_file "test/fixtures/product_lines.yml"
assert_migration "db/migrate/create_product_lines.rb", /belongs_to :product, index: true/
assert_migration "db/migrate/create_product_lines.rb", /references :user, index: true/
@@ -60,7 +60,7 @@ def test_scaffold_on_invoke
end
end
- assert_file "test/functional/product_lines_controller_test.rb" do |test|
+ assert_file "test/controllers/product_lines_controller_test.rb" do |test|
assert_match(/class ProductLinesControllerTest < ActionController::TestCase/, test)
assert_match(/post :create, product_line: \{ title: @product_line.title \}/, test)
assert_match(/put :update, id: @product_line, product_line: \{ title: @product_line.title \}/, test)
@@ -78,7 +78,7 @@ def test_scaffold_on_invoke
# Helpers
assert_file "app/helpers/product_lines_helper.rb"
- assert_file "test/unit/helpers/product_lines_helper_test.rb"
+ assert_file "test/helpers/product_lines_helper_test.rb"
# Assets
assert_file "app/assets/stylesheets/scaffold.css"
@@ -89,7 +89,7 @@ def test_scaffold_on_invoke
def test_functional_tests_without_attributes
run_generator ["product_line"]
- assert_file "test/functional/product_lines_controller_test.rb" do |content|
+ assert_file "test/controllers/product_lines_controller_test.rb" do |content|
assert_match(/class ProductLinesControllerTest < ActionController::TestCase/, content)
assert_match(/test "should get index"/, content)
assert_match(/post :create, product_line: \{ \}/, content)
@@ -103,7 +103,7 @@ def test_scaffold_on_revoke
# Model
assert_no_file "app/models/product_line.rb"
- assert_no_file "test/unit/product_line_test.rb"
+ assert_no_file "test/models/product_line_test.rb"
assert_no_file "test/fixtures/product_lines.yml"
assert_no_migration "db/migrate/create_product_lines.rb"
@@ -114,7 +114,7 @@ def test_scaffold_on_revoke
# Controller
assert_no_file "app/controllers/product_lines_controller.rb"
- assert_no_file "test/functional/product_lines_controller_test.rb"
+ assert_no_file "test/controllers/product_lines_controller_test.rb"
# Views
assert_no_file "app/views/product_lines"
@@ -122,7 +122,7 @@ def test_scaffold_on_revoke
# Helpers
assert_no_file "app/helpers/product_lines_helper.rb"
- assert_no_file "test/unit/helpers/product_lines_helper_test.rb"
+ assert_no_file "test/helpers/product_lines_helper_test.rb"
# Assets
assert_file "app/assets/stylesheets/scaffold.css", /:visited/
@@ -136,7 +136,7 @@ def test_scaffold_with_namespace_on_invoke
# Model
assert_file "app/models/admin.rb", /module Admin/
assert_file "app/models/admin/role.rb", /class Admin::Role < ActiveRecord::Base/
- assert_file "test/unit/admin/role_test.rb", /class Admin::RoleTest < ActiveSupport::TestCase/
+ assert_file "test/models/admin/role_test.rb", /class Admin::RoleTest < ActiveSupport::TestCase/
assert_file "test/fixtures/admin/roles.yml"
assert_migration "db/migrate/create_admin_roles.rb"
@@ -183,7 +183,7 @@ def test_scaffold_with_namespace_on_invoke
end
end
- assert_file "test/functional/admin/roles_controller_test.rb",
+ assert_file "test/controllers/admin/roles_controller_test.rb",
/class Admin::RolesControllerTest < ActionController::TestCase/
# Views
@@ -198,7 +198,7 @@ def test_scaffold_with_namespace_on_invoke
# Helpers
assert_file "app/helpers/admin/roles_helper.rb"
- assert_file "test/unit/helpers/admin/roles_helper_test.rb"
+ assert_file "test/helpers/admin/roles_helper_test.rb"
# Assets
assert_file "app/assets/stylesheets/scaffold.css", /:visited/
@@ -213,7 +213,7 @@ def test_scaffold_with_namespace_on_revoke
# Model
assert_file "app/models/admin.rb" # ( should not be remove )
assert_no_file "app/models/admin/role.rb"
- assert_no_file "test/unit/admin/role_test.rb"
+ assert_no_file "test/models/admin/role_test.rb"
assert_no_file "test/fixtures/admin/roles.yml"
assert_no_migration "db/migrate/create_admin_roles.rb"
@@ -224,7 +224,7 @@ def test_scaffold_with_namespace_on_revoke
# Controller
assert_no_file "app/controllers/admin/roles_controller.rb"
- assert_no_file "test/functional/admin/roles_controller_test.rb"
+ assert_no_file "test/controllers/admin/roles_controller_test.rb"
# Views
assert_no_file "app/views/admin/roles"
@@ -232,7 +232,7 @@ def test_scaffold_with_namespace_on_revoke
# Helpers
assert_no_file "app/helpers/admin/roles_helper.rb"
- assert_no_file "test/unit/helpers/admin/roles_helper_test.rb"
+ assert_no_file "test/helpers/admin/roles_helper_test.rb"
# Assets
assert_file "app/assets/stylesheets/scaffold.css"
Something went wrong with that request. Please try again.