├── lib └── tasks │ ├── .gitkeep │ └── cucumber.rake ├── public ├── favicon.ico ├── javascripts │ ├── .gitkeep │ └── application.js ├── stylesheets │ └── .gitkeep ├── images │ └── rails.png ├── robots.txt ├── 422.html ├── 404.html └── 500.html ├── .rspec ├── vendor └── plugins │ └── .gitkeep ├── .rvmrc ├── app ├── helpers │ ├── articles_helper.rb │ └── application_helper.rb ├── views │ ├── articles │ │ ├── new.html.erb │ │ ├── edit.html.erb │ │ ├── show.html.erb │ │ ├── index.html.erb │ │ └── _form.html.erb │ └── layouts │ │ └── application.html.erb ├── controllers │ ├── application_controller.rb │ └── articles_controller.rb └── models │ ├── article.rb │ └── user.rb ├── autotest └── discover.rb ├── .gitignore ├── spec ├── controllers │ └── articles_controller_spec.rb ├── models │ ├── user_spec.rb │ └── article_spec.rb ├── factories.rb └── spec_helper.rb ├── config.ru ├── config ├── environment.rb ├── initializers │ ├── mime_types.rb │ ├── inflections.rb │ ├── session_store.rb │ ├── backtrace_silencers.rb │ ├── secret_token.rb │ └── devise.rb ├── locales │ ├── en.yml │ └── devise.en.yml ├── boot.rb ├── cucumber.yml ├── database.yml ├── environments │ ├── development.rb │ ├── test.rb │ └── production.rb ├── routes.rb └── application.rb ├── doc └── README_FOR_APP ├── db ├── migrate │ ├── 20100917022609_add_user_id_to_articles.rb │ ├── 20100903014530_create_articles.rb │ └── 20100917004442_devise_create_users.rb ├── seeds.rb └── schema.rb ├── Rakefile ├── features ├── step_definitions │ ├── article_steps.rb │ ├── common_steps.rb │ ├── email_steps.rb │ └── web_steps.rb ├── editing_article.feature ├── homepage.feature ├── support │ ├── paths.rb │ └── env.rb ├── create_article.feature └── new_user_signup.feature ├── script ├── rails └── cucumber ├── Gemfile ├── Gemfile.lock └── README /lib/tasks/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --colour 2 | -------------------------------------------------------------------------------- /vendor/plugins/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/javascripts/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/stylesheets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.rvmrc: -------------------------------------------------------------------------------- 1 | rvm use 1.8.7@bddclass 2 | -------------------------------------------------------------------------------- /public/javascripts/application.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/helpers/articles_helper.rb: -------------------------------------------------------------------------------- 1 | module ArticlesHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /autotest/discover.rb: -------------------------------------------------------------------------------- 1 | Autotest.add_discovery { "rails" } 2 | Autotest.add_discovery { "rspec2" } 3 | -------------------------------------------------------------------------------- /public/images/rails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edebill/intro_bdd/master/public/images/rails.png -------------------------------------------------------------------------------- /app/views/articles/new.html.erb: -------------------------------------------------------------------------------- 1 |
<%= @article.body %>
3 | -------------------------------------------------------------------------------- /app/models/article.rb: -------------------------------------------------------------------------------- 1 | class Article < ActiveRecord::Base 2 | belongs_to :user 3 | 4 | validates_presence_of :title, :body 5 | validates_uniqueness_of :title 6 | end 7 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Blog::Application 5 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the rails application 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the rails application 5 | Blog::Application.initialize! 6 | -------------------------------------------------------------------------------- /doc/README_FOR_APP: -------------------------------------------------------------------------------- 1 | Use this README file to introduce your application and point to useful places in the API for learning more. 2 | Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries. 3 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-Agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | # Mime::Type.register_alias "text/html", :iphone 6 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Sample localization file for English. Add more files in this directory for other locales. 2 | # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. 3 | 4 | en: 5 | hello: "Hello world" 6 | -------------------------------------------------------------------------------- /db/migrate/20100917022609_add_user_id_to_articles.rb: -------------------------------------------------------------------------------- 1 | class AddUserIdToArticles < ActiveRecord::Migration 2 | def self.up 3 | add_column :articles, :user_id, :integer 4 | end 5 | 6 | def self.down 7 | remove_column :articles, :user_id 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | require 'rake' 6 | 7 | Blog::Application.load_tasks 8 | -------------------------------------------------------------------------------- /app/views/articles/index.html.erb: -------------------------------------------------------------------------------- 1 |Maybe you tried to change something you didn't have access to.
24 |You may have mistyped the address or the page may have moved.
24 |We've been notified about this issue and we'll take a look at it shortly.
24 |