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
Capybara is a testing framework for clicking around in the browser (integration test). | |
You can use Capybara with Minitest here: https://github.com/blowmage/minitest-rails-capybara | |
Sometimes you'll need to run tests with Javascript enabled. I recommend using a gem poltergeist for that. https://github.com/teampoltergeist/poltergeist | |
For mockups/wirreframing, try out Balsamiq. |
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
module ApplicationHelper | |
YEAR_DESC_OPENED = 1996 | |
OLDEST_SUPPORTED_BIRTH_YEAR = 1910 | |
def years_in_business | |
(YEAR_DESC_OPENED..current_year).to_a.reverse | |
end | |
def current_year | |
Date.current.year |
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
class ApplicationController < ActionController::Base | |
private | |
# Overwriting the sign_out redirect path method | |
def after_sign_out_path_for(resource_or_scope) | |
root_path | |
end | |
# Overwriting the sign_in redirect path method | |
def after_sign_out_path_for(resource_or_scope) |
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
# Gemfile | |
group :test do | |
gem 'capybara' # Simulate user | |
gem 'cucumber-rails', require: false # Acceptance tests | |
gem 'database_cleaner' # Clean test db | |
gem 'factory_girl_rails' # Factories for tests | |
gem 'puffing-billy' # Handle external HTTP requests made by front-end (JavaScript) | |
gem 'rspec-rails' # Functional tests | |
gem 'selenium-webdriver' # Visually run tests |
NewerOlder