Skip to content

Instantly share code, notes, and snippets.

View JanDintel's full-sized avatar

JanDintel

View GitHub Profile
@JanDintel
JanDintel / readme.md
Last active December 20, 2015 05:38
Use Factory Girl for user helper in Cucumber

Using Factory Girl with a helper for Cucumber

Using Factory Girl directly in your steps

(./features/step_definitions/function_name_steps.rb)

Given /^the user has an account$/ do
    @user = FactoryGirl.create(:user)
end
@JanDintel
JanDintel / Factory Girl and Cucumber.md
Created July 25, 2013 09:13
Factory Girl and Cucumber testing

Factory Girl and Cucumber

Use the outside to inside method. Your features should be abstract and using Factory Girl step definitions forces you to know specific details about the implementation of your application. See: http://robots.thoughtbot.com/post/25650434584/writing-better-cucumber-scenarios-or-why-were So keep in mind, you're testing the logic of the models (methodes, validations..) and controllers with Rspec and the views and 'behavior' of the end user with Cucumber. For some of those best practices, see: http://blog.codeship.io/2013/05/21/testing-tuesday-6-top-5-cucumber-best-practices.html

@JanDintel
JanDintel / install.md
Last active July 20, 2016 10:57
Install guide for Rspec, Guard, Spork, Cucumber and Mongoid

Install Cucumber with Rspec, Guard, Factory Girl(?) and Spork

Using during Hartl rails 4.0 guide (http://ruby.railstutorial.org/chapters)

Gems

group :development, :test
  gem 'guard-rspec'
  gem 'guard-livereload'
  gem 'spork-rails', github: 'sporkrb/spork-rails' # rubygems version not rails 4 compatible
  gem 'guard-spork'
@JanDintel
JanDintel / install.md
Last active December 20, 2015 04:29
Install Cucumber with Rspec, Guard (and livereload) and Spork

Install Cucumber with Rspec, Guard and Spork

Using during Hartl rails 4.0 guide (http://ruby.railstutorial.org/chapters)

Gems

group :development, :test
  gem 'guard-rspec'
  gem 'guard-livereload'
  gem 'spork-rails', github: 'sporkrb/spork-rails' # RubyGems.org nog uptodate
  gem 'guard-spork'

gem 'childprocess'

@JanDintel
JanDintel / .gitconfig
Created July 23, 2013 11:27
Global gitconfig ~/.gitconfig
[alias]
co = checkout
st = status
br = branch
com = commit
pl = pull
ps = push
@JanDintel
JanDintel / defaultglobal.gitignore
Created July 18, 2013 14:19
My default ROR on OS X gitignore
# Rails
*.rbc
*.sassc
.sass-cache
capybara-*.html
.rspec
.rvmrc
/.bundle
/vendor/bundle
/log/*
@JanDintel
JanDintel / devise.nl.yml
Last active December 16, 2015 11:08
Dutch translation for Devise. Nederlandse vertaling voor Devise.
# Meer vetalingen via https://github.com/plataformatec/devise/wiki/I18n
# Voeg 'config.i18n.default_locale = :nl' toe in je 'application.rb' en herstart je server
nl:
devise:
confirmations:
confirmed: "Je account is bevestigd, je bent nu ingelogd."
send_instructions: "Je zult een e-mail met instructies ontvangen over hoe je jouw account moet bevestigen over een paar minuten."
send_paranoid_instructions: "Als je e-mail bestaat in onze database, zul je een e-mail met instructies ontvangen over hoe je jouw account moet bevestigen over een paar minuten."
failure: