Permalink
Browse files

5.2) Move sample rails project to 5.2-bdd-demo-complete

  • Loading branch information...
1 parent 70bed6a commit 9243c5ab5d2b4aeb39919a8212d4f7ee917a143d @dimroc dimroc committed May 13, 2012
Showing with 19 additions and 3 deletions.
  1. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/.gitignore
  2. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/.rspec
  3. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/.rvmrc
  4. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/Gemfile
  5. +5 −1 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/Gemfile.lock
  6. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/README.md
  7. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/Rakefile
  8. BIN lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/assets/images/rails.png
  9. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/assets/javascripts/application.js
  10. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/assets/javascripts/posts.js.coffee
  11. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/assets/stylesheets/application.css.scss
  12. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/assets/stylesheets/posts.css.scss
  13. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/controllers/application_controller.rb
  14. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/controllers/home_controller.rb
  15. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/controllers/posts_controller.rb
  16. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/helpers/application_helper.rb
  17. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/helpers/posts_helper.rb
  18. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/mailers/.gitkeep
  19. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/models/.gitkeep
  20. lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/models/post.rb
  21. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/models/user.rb
  22. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/views/home/index.html.haml
  23. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/views/layouts/application.html.haml
  24. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/views/posts/index.html.haml
  25. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/views/posts/new.html.haml
  26. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/app/views/posts/show.html.haml
  27. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config.ru
  28. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config/application.rb
  29. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config/boot.rb
  30. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config/database.yml
  31. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config/environment.rb
  32. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config/environments/development.rb
  33. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config/environments/production.rb
  34. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config/environments/test.rb
  35. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config/initializers/backtrace_silencers.rb
  36. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config/initializers/devise.rb
  37. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config/initializers/inflections.rb
  38. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config/initializers/mime_types.rb
  39. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config/initializers/secret_token.rb
  40. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config/initializers/session_store.rb
  41. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config/initializers/wrap_parameters.rb
  42. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config/locales/devise.en.yml
  43. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config/locales/en.yml
  44. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/config/routes.rb
  45. 0 .../05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/db/migrate/20120220205915_devise_create_users.rb
  46. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/db/migrate/20120220235552_create_posts.rb
  47. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/db/schema.rb
  48. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/db/seeds.rb
  49. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/doc/README_FOR_APP
  50. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/lib/assets/.gitkeep
  51. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/lib/tasks/.gitkeep
  52. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/public/404.html
  53. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/public/422.html
  54. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/public/500.html
  55. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/public/favicon.ico
  56. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/public/robots.txt
  57. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/script/rails
  58. +9 −0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/spec/controllers/posts_controller_spec.rb
  59. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/spec/fabricators/user_fabricator.rb
  60. +3 −0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/spec/models/post_spec.rb
  61. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/spec/models/user_spec.rb
  62. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/spec/requests/post_spec.rb
  63. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/spec/requests/user_spec.rb
  64. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/spec/spec_helper.rb
  65. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/spec/support/database_cleaner.rb
  66. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/spec/support/devise.rb
  67. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/vendor/assets/javascripts/.gitkeep
  68. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/vendor/assets/stylesheets/.gitkeep
  69. 0 lectures/05-rspec/{5.2-bdd-demo → 5.2-bdd-demo-complete}/vendor/plugins/.gitkeep
@@ -144,7 +144,11 @@ GEM
ffi (~> 1.0.9)
json_pure
rubyzip
- shoulda (2.11.3)
+ shoulda (3.0.1)
+ shoulda-context (~> 1.0.0)
+ shoulda-matchers (~> 1.0.0)
+ shoulda-context (1.0.0)
+ shoulda-matchers (1.0.0)
simple_form (1.5.2)
actionpack (~> 3.0)
activemodel (~> 3.0)
@@ -1,7 +1,7 @@
class Post < ActiveRecord::Base
+ belongs_to :user
+
validates_presence_of :content
validates_presence_of :user_id
validates_presence_of :title
-
- belongs_to :user
end
@@ -16,6 +16,15 @@
assigns(:posts).should_not be_nil
end
+ it "POST#create" do
+ title = Faker::Lorem.word
+ content = Faker::Lorem.paragraph
+ expect {
+ post :create, post: { title: title, content: content }
+ assigns(:post).should_not be_nil
+ }.to change { Post.count }.by(1)
+ end
+
it "GET#new" do
get :new
post = assigns(:post)
@@ -1,6 +1,9 @@
require 'spec_helper'
describe Post do
+ describe "associations" do
+ it { should belong_to :user }
+ end
describe "validations" do
it { should validate_presence_of :content }
it { should validate_presence_of :title }

0 comments on commit 9243c5a

Please sign in to comment.