Version: 1.9.8
Platform: x86_64
First, install or update to the latest system software.
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
# Put this in lib/templates/rspec/scaffold/controller_spec.rb | |
require 'rails_helper' | |
<% module_namespacing do -%> | |
RSpec.describe <%= controller_class_name %>Controller, :type => :controller do | |
<% unless options[:singleton] -%> | |
describe "GET #index" do | |
let!(:<%= file_name %>) { create(:<%= file_name %>) } |
inputs = %w[ | |
CollectionSelectInput | |
DateTimeInput | |
FileInput | |
GroupedCollectionSelectInput | |
NumericInput | |
PasswordInput | |
RangeInput | |
StringInput | |
TextInput |
This gist was writen in 2012 and it was solving specific problem in Rails & SimpleForm. Some fellow developers were pointing out this may be out dated concept. That's why I advise everyone to read comment section bellow to have a full grasp of alternative solutions
other sources that may be helpful to understand why this may not be best idea:
# === EDITOR === | |
Pry.editor = 'vim' | |
# == Pry-Nav - Using pry as a debugger == | |
Pry.commands.alias_command 'c', 'continue' rescue nil | |
Pry.commands.alias_command 's', 'step' rescue nil | |
Pry.commands.alias_command 'n', 'next' rescue nil | |
Pry.commands.alias_command 'r!', 'reload!' rescue nil | |
Pry.config.color = true |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
# Recursively diff two hashes, showing only the differing values. | |
# By Henrik Nyh <http://henrik.nyh.se> 2009-07-14 under the MIT license. | |
# | |
# Example: | |
# | |
# a = { | |
# "same" => "same", | |
# "diff" => "a", | |
# "only a" => "a", | |
# "nest" => { |