+ <% end %>
+<% end %>
diff --git a/app/views/votes/_new.html.erb b/app/views/votes/_new.html.erb
new file mode 100644
index 0000000..5398f3e
--- /dev/null
+++ b/app/views/votes/_new.html.erb
@@ -0,0 +1,9 @@
+<%= form_for [votable, @vote] do |f| %>
+ <%= f.label "+1" %>
+ <%= f.radio_button(:value, 1) %>
+ <%= f.label "-1" %>
+ <%= f.radio_button(:value, -1) %>
+ <%= f.submit "Vote!"%>
+<% end %>
+
+
diff --git a/config/application.rb b/config/application.rb
index 6b38561..3ee6e29 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -15,6 +15,7 @@
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
+module StackOverflow
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
diff --git a/config/database.yml b/config/database.yml
index ad36b76..c434ac6 100644
--- a/config/database.yml
+++ b/config/database.yml
@@ -23,13 +23,13 @@ default: &default
development:
<<: *default
- database: unicorn_vs_dragon_development
+ database: stack_overflow_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: unicorn_vs_dragon
+ #username:
# The password associated with the postgres role (username).
#password:
@@ -57,7 +57,7 @@ development:
# Do not set this db to the same as development or production.
test:
<<: *default
- database: unicorn_vs_dragon_test
+ database: stack_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
@@ -80,6 +80,6 @@ test:
#
production:
<<: *default
- database: unicorn_vs_dragon_production
- username: unicorn_vs_dragon
+ database: stack_overflow_production
+ username: overflow
password: <%= ENV['UNICORN_VS_DRAGON_DATABASE_PASSWORD'] %>
diff --git a/config/routes.rb b/config/routes.rb
index 3f66539..d6e7e73 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -2,6 +2,10 @@
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
+ root 'questions#index'
+
+ get 'questions/trending' => 'questions#trending', as: :trending
+ get 'questions/voted' => 'questions#voted', as: :voted
# You can have the root of your site routed with "root"
# root 'welcome#index'
@@ -53,4 +57,26 @@
# # (app/controllers/admin/products_controller.rb)
# resources :products
# end
+
+ resources :users, only: [:new, :create]
+
+ resources :sessions, only:[:create, :destroy]
+
+ get 'login' => 'sessions#new'
+ get 'logout'=> 'sessions#destroy'
+
+
+ resources :questions do
+ resources :answers, only: [:create, :destroy]
+ resources :comments, only: [:new, :create]
+ resources :votes, only: [:create, :update]
+ end
+ resources :answers do
+ resources :comments, only:[:new, :create]
+ resources :votes, only: [:create, :update]
+ end
+
+ resources :comments, only: [:new, :create] do
+ resources :votes, only: [:create, :update]
+ end
end
diff --git a/db/migrate/20151231194341_create_users.rb b/db/migrate/20151231194341_create_users.rb
new file mode 100644
index 0000000..72a9f38
--- /dev/null
+++ b/db/migrate/20151231194341_create_users.rb
@@ -0,0 +1,10 @@
+class CreateUsers < ActiveRecord::Migration
+ def change
+ create_table :users do |t|
+ t.string :username
+ t.string :password_digest
+
+ t.timestamps null: false
+ end
+ end
+end
diff --git a/db/migrate/20151231194536_create_questions.rb b/db/migrate/20151231194536_create_questions.rb
new file mode 100644
index 0000000..d77e184
--- /dev/null
+++ b/db/migrate/20151231194536_create_questions.rb
@@ -0,0 +1,11 @@
+class CreateQuestions < ActiveRecord::Migration
+ def change
+ create_table :questions do |t|
+ t.string :title
+ t.string :body
+ t.references :user, index: true, foreign_key: true
+
+ t.timestamps null: false
+ end
+ end
+end
diff --git a/db/migrate/20151231194616_create_answers.rb b/db/migrate/20151231194616_create_answers.rb
new file mode 100644
index 0000000..7b10fa5
--- /dev/null
+++ b/db/migrate/20151231194616_create_answers.rb
@@ -0,0 +1,11 @@
+class CreateAnswers < ActiveRecord::Migration
+ def change
+ create_table :answers do |t|
+ t.string :body
+ t.references :user, index: true, foreign_key: true
+ t.references :question, index: true, foreign_key: true
+
+ t.timestamps null: false
+ end
+ end
+end
diff --git a/db/migrate/20151231194834_create_comments.rb b/db/migrate/20151231194834_create_comments.rb
new file mode 100644
index 0000000..7314606
--- /dev/null
+++ b/db/migrate/20151231194834_create_comments.rb
@@ -0,0 +1,11 @@
+class CreateComments < ActiveRecord::Migration
+ def change
+ create_table :comments do |t|
+ t.references :user, index: true, foreign_key: true
+ t.references :commentable, polymorphic: true, index: true
+ t.string :body
+
+ t.timestamps null: false
+ end
+ end
+end
diff --git a/db/migrate/20151231195101_create_votes.rb b/db/migrate/20151231195101_create_votes.rb
new file mode 100644
index 0000000..561acdb
--- /dev/null
+++ b/db/migrate/20151231195101_create_votes.rb
@@ -0,0 +1,11 @@
+class CreateVotes < ActiveRecord::Migration
+ def change
+ create_table :votes do |t|
+ t.references :user, index: true, foreign_key: true
+ t.references :votable, polymorphic: true, index: true
+ t.integer :value
+
+ t.timestamps null: false
+ end
+ end
+end
diff --git a/db/migrate/20160103005011_add_accepted_answer_idto_questions.rb b/db/migrate/20160103005011_add_accepted_answer_idto_questions.rb
new file mode 100644
index 0000000..7551655
--- /dev/null
+++ b/db/migrate/20160103005011_add_accepted_answer_idto_questions.rb
@@ -0,0 +1,5 @@
+class AddAcceptedAnswerIdtoQuestions < ActiveRecord::Migration
+ def change
+ add_column :questions, :accepted_answer_id, :integer
+ end
+end
diff --git a/db/migrate/20160103022855_add_column_to_user.rb b/db/migrate/20160103022855_add_column_to_user.rb
new file mode 100644
index 0000000..401cd62
--- /dev/null
+++ b/db/migrate/20160103022855_add_column_to_user.rb
@@ -0,0 +1,5 @@
+class AddColumnToUser < ActiveRecord::Migration
+ def change
+ add_column :users, :author_id, :integer
+ end
+end
diff --git a/db/migrate/20160103184543_remove_author_id_from_users.rb b/db/migrate/20160103184543_remove_author_id_from_users.rb
new file mode 100644
index 0000000..9e5f290
--- /dev/null
+++ b/db/migrate/20160103184543_remove_author_id_from_users.rb
@@ -0,0 +1,6 @@
+class RemoveAuthorIdFromUsers < ActiveRecord::Migration
+ def change
+ remove_column :users, :author_id, :integer
+ add_column :votes, :author_id, :integer
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
new file mode 100644
index 0000000..3bece20
--- /dev/null
+++ b/db/schema.rb
@@ -0,0 +1,78 @@
+# 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: 20160103210535) do
+
+ # These are extensions that must be enabled in order to support this database
+ enable_extension "plpgsql"
+
+ create_table "answers", force: :cascade do |t|
+ t.string "body"
+ t.integer "user_id"
+ t.integer "question_id"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ add_index "answers", ["question_id"], name: "index_answers_on_question_id", using: :btree
+ add_index "answers", ["user_id"], name: "index_answers_on_user_id", using: :btree
+
+ create_table "comments", force: :cascade do |t|
+ t.integer "user_id"
+ t.integer "commentable_id"
+ t.string "commentable_type"
+ t.string "body"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ add_index "comments", ["commentable_type", "commentable_id"], name: "index_comments_on_commentable_type_and_commentable_id", using: :btree
+ add_index "comments", ["user_id"], name: "index_comments_on_user_id", using: :btree
+
+ create_table "questions", force: :cascade do |t|
+ t.string "title"
+ t.string "body"
+ t.integer "user_id"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.integer "accepted_answer_id"
+ end
+
+ add_index "questions", ["user_id"], name: "index_questions_on_user_id", using: :btree
+
+ create_table "users", force: :cascade do |t|
+ t.string "username"
+ t.string "password_digest"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "votes", force: :cascade do |t|
+ t.integer "user_id"
+ t.integer "votable_id"
+ t.string "votable_type"
+ t.integer "value", default: 0
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.integer "author_id"
+ end
+
+ add_index "votes", ["user_id"], name: "index_votes_on_user_id", using: :btree
+ add_index "votes", ["votable_type", "votable_id"], name: "index_votes_on_votable_type_and_votable_id", using: :btree
+
+ add_foreign_key "answers", "questions"
+ add_foreign_key "answers", "users"
+ add_foreign_key "comments", "users"
+ add_foreign_key "questions", "users"
+ add_foreign_key "votes", "users"
+end
diff --git a/db/seeds.rb b/db/seeds.rb
index 4edb1e8..b6fb4d9 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -1,7 +1,14 @@
-# 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)
+u = User.create!(username: "christopher", password: "123456")
+10.times do
+ q = Question.create!(title: Faker::Hipster.sentence(8), body: Faker::Hipster.sentence(10, true, 5), user_id: u.id)
+ 3.times do
+ c = Comment.create!(body: Faker::Hipster.sentence(10, true, 5), user_id: u.id, commentable_id: q.id, commentable_type: "Question")
+ end
+ 6.times do
+ a = Answer.create!(body: Faker::Hipster.sentence(10, true, 5), user_id: u.id, question_id: q.id)
+ 3.times do
+ c = Comment.create!(body: Faker::Hipster.sentence(10, true, 5), user_id: u.id, commentable_id: a.id, commentable_type: "Answer")
+ end
+ end
+end
+
diff --git a/log/.keep b/log/.keep
deleted file mode 100644
index e69de29..0000000
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
new file mode 100644
index 0000000..2e470db
--- /dev/null
+++ b/spec/controllers/users_controller_spec.rb
@@ -0,0 +1,33 @@
+# require 'rails_helper'
+
+# RSpec.describe UsersController, type: :controller do
+
+# describe "GET #new" do
+# it "returns http success" do
+# get :new
+# expect(response).to have_http_status(:success)
+# end
+# end
+
+# describe "GET #create" do
+# it "returns http success" do
+# get :create
+# expect(response).to have_http_status(:success)
+# end
+# end
+
+# describe "GET #edit" do
+# it "returns http success" do
+# get :edit
+# expect(response).to have_http_status(:success)
+# end
+# end
+
+# describe "GET #destroy" do
+# it "returns http success" do
+# get :destroy
+# expect(response).to have_http_status(:success)
+# end
+# end
+
+# end
diff --git a/spec/factories.rb b/spec/factories.rb
new file mode 100644
index 0000000..d045bcf
--- /dev/null
+++ b/spec/factories.rb
@@ -0,0 +1,15 @@
+
+
+
+# FactoryGirl.define do
+# factory :user, aliases: [:author] do
+# username "fakeaccount"
+# password "password"
+# end
+
+# factory :question do
+# title Faker::Hipster.sentence(6)
+# body Faker::Hipster.sentence(10, true, 5)
+# user
+# end
+# end
diff --git a/spec/factories/answers.rb b/spec/factories/answers.rb
new file mode 100644
index 0000000..86cab62
--- /dev/null
+++ b/spec/factories/answers.rb
@@ -0,0 +1,8 @@
+FactoryGirl.define do
+ factory :answer do
+ body "MyString"
+user_id nil
+question_id nil
+ end
+
+end
diff --git a/spec/factories/comments.rb b/spec/factories/comments.rb
new file mode 100644
index 0000000..3a6e3e5
--- /dev/null
+++ b/spec/factories/comments.rb
@@ -0,0 +1,8 @@
+FactoryGirl.define do
+ factory :comment do
+ user_id nil
+commentable nil
+body "MyString"
+ end
+
+end
diff --git a/spec/factories/questions.rb b/spec/factories/questions.rb
new file mode 100644
index 0000000..07539bd
--- /dev/null
+++ b/spec/factories/questions.rb
@@ -0,0 +1,8 @@
+FactoryGirl.define do
+ factory :question do
+ title "MyString"
+body "MyString"
+user_id nil
+ end
+
+end
diff --git a/spec/factories/users.rb b/spec/factories/users.rb
new file mode 100644
index 0000000..6dfba06
--- /dev/null
+++ b/spec/factories/users.rb
@@ -0,0 +1,7 @@
+FactoryGirl.define do
+ factory :user do
+ username "MyString"
+password_digest "MyString"
+ end
+
+end
diff --git a/spec/factories/votes.rb b/spec/factories/votes.rb
new file mode 100644
index 0000000..511ff81
--- /dev/null
+++ b/spec/factories/votes.rb
@@ -0,0 +1,8 @@
+FactoryGirl.define do
+ factory :vote do
+ user nil
+votable nil
+value 1
+ end
+
+end
diff --git a/spec/models/answer_spec.rb b/spec/models/answer_spec.rb
new file mode 100644
index 0000000..e594ea3
--- /dev/null
+++ b/spec/models/answer_spec.rb
@@ -0,0 +1,9 @@
+require 'rails_helper'
+
+RSpec.describe Answer, type: :model do
+ it {should have_many(:comments)}
+ it {should have_many(:votes)}
+ it {should belong_to(:user)}
+ it {should belong_to(:question)}
+
+end
diff --git a/spec/models/comment_spec.rb b/spec/models/comment_spec.rb
new file mode 100644
index 0000000..c10688d
--- /dev/null
+++ b/spec/models/comment_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe Comment, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/question_spec.rb b/spec/models/question_spec.rb
new file mode 100644
index 0000000..fbe31c3
--- /dev/null
+++ b/spec/models/question_spec.rb
@@ -0,0 +1,7 @@
+# require 'rails_helper'
+
+# RSpec.describe Question, type: :model do
+# it {should validate_presence_of (:title) }
+# it {should validate_presence_of (:body) }
+# it {should validate_presence_of (:user_id)}
+# end
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
new file mode 100644
index 0000000..d199407
--- /dev/null
+++ b/spec/models/user_spec.rb
@@ -0,0 +1,34 @@
+require 'rails_helper'
+
+RSpec.describe User, type: :model do
+ it { should validate_presence_of(:username) }
+ it { should validate_uniqueness_of(:username) }
+ it { should validate_length_of(:username).is_at_least(3) }
+ it { should validate_presence_of(:password) }
+ it { should validate_length_of(:password).is_at_least(6) }
+ it { should have_many(:questions) }
+ it { should have_many(:answers) }
+ it { should have_many(:comments) }
+ it { should have_many(:votes) }
+
+ it "is invalid without a username" do
+ user = User.new(username: nil, password_digest: "password")
+ expect(user).not_to be_valid
+ end
+
+ it "is invalid without a password" do
+ user = User.new(username: "username", password_digest: nil)
+ expect(user).not_to be_valid
+ end
+
+ # before(:each) do
+ # user = User.new @attr
+ # user.password = 'password'
+ # user.password_confirmation = 'password'
+ # user.save!
+ # end
+
+
+
+
+end
diff --git a/spec/models/vote_spec.rb b/spec/models/vote_spec.rb
new file mode 100644
index 0000000..7f550be
--- /dev/null
+++ b/spec/models/vote_spec.rb
@@ -0,0 +1,7 @@
+require 'rails_helper'
+
+RSpec.describe Vote, type: :model do
+ it {should belong_to(:user)}
+ it {should belong_to(:votable)}
+ it {should belong_to(:author).class_name('User')}
+end
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
new file mode 100644
index 0000000..2d92944
--- /dev/null
+++ b/spec/rails_helper.rb
@@ -0,0 +1,62 @@
+# This file is copied to spec/ when you run 'rails generate rspec:install'
+ENV['RAILS_ENV'] ||= 'test'
+require File.expand_path('../../config/environment', __FILE__)
+# Prevent database truncation if the environment is production
+abort("The Rails environment is running in production mode!") if Rails.env.production?
+require 'spec_helper'
+require 'rspec/rails'
+require 'simplecov'
+SimpleCov.start
+
+
+
+# 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 migration and applies them 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!
+
+ # Filter lines from Rails gems in backtraces.
+ config.filter_rails_from_backtrace!
+ # arbitrary gems may also be filtered via:
+ # config.filter_gems_from_backtrace("gem name")
+end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
new file mode 100644
index 0000000..61e2738
--- /dev/null
+++ b/spec/spec_helper.rb
@@ -0,0 +1,92 @@
+# 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
+
+ # Allows RSpec to persist some state between runs in order to support
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
+ # you configure your source control system to ignore this file.
+ config.example_status_persistence_file_path = "spec/examples.txt"
+
+ # Limits the available syntax to the non-monkey patched syntax that is
+ # recommended. For more details, see:
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
+ 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/spec/support/shoulda_matcher.rb b/spec/support/shoulda_matcher.rb
index e69de29..dc0c322 100644
--- a/spec/support/shoulda_matcher.rb
+++ b/spec/support/shoulda_matcher.rb
@@ -0,0 +1,6 @@
+Shoulda::Matchers.configure do |config|
+ config.integrate do |with|
+ with.test_framework :rspec
+ with.library :rails
+ end
+end
\ No newline at end of file
<%=comment.body%>
+Points:<%=comment.count_votes%>
+ <%= render :partial =>"votes/new", :controller => "votes", locals: {votable: comment} %> +