Last active
July 6, 2017 10:58
-
-
Save jnicho02/914ea2dae44b879389beeea38e2e990a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Take a look at the Rails Guide to Testing: http://guides.rubyonrails.org/testing.html | |
Rails has unit testing using MiniTest by default. | |
When you ran the scaffolding it created a controller test /test/controllers/topics_controller_test.rb | |
Add to /test/models/topic_test.rb: | |
class TopicTest < ActiveSupport::TestCase | |
test "set a title" do | |
t = Topic.new | |
t.title = "Hi there" | |
assert t.title == "Hi theres" | |
end | |
end | |
run the tests: | |
$ rails test | |
Add to gemfile: | |
gem 'rspec-rails' | |
rails g rspec:install | |
...soem more stuff about rspec testing.... | |
Capybara: | |
Cloud 9 might need headless https://www.stefanwienert.de/blog/2015/07/24/how-to-install-capybara-webkit-for-ubuntu-12-dot-04/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment