24 Aug '13, 5am

letメソッドとFactory Girl - RSpec/Capybara 入門。連載第5回、書きました。

letメソッドとFactory Girl - RSpec/Capybara 入門。連載第5回、書きました。

require 'spec_helper' describe Customer do specify '妥当なオブジェクト' do customer = Customer.new( family_name: '山田', given_name: '太郎', family_name_kana: 'ヤマダ', given_name_kana: 'タロウ' ) expect(customer).to be_valid end %w{family_name given_name family_name_kana given_name_kana}.each do |column_name| specify "#{column_name} は空であってはならない" do customer = Customer.new( family_name: '山田', given_name: '太郎', family_name_kana: 'ヤマダ', given_name_kana: 'タロウ' ) customer[column_name] = '' expect(customer).not_to be_valid expect(customer.errors[column_name]).to be_present end specify "#{column_name} は40文字以内" do customer = Customer.new( family_name: '山田', given_name: '太郎', family_name_kana: 'ヤマダ', given_name_kana: 'タロウ' ) customer[column_name] = 'ア' * 41 expect(customer).not_to be_valid expect(customer.errors[column_name]).to be_present end end end

Full article: http://www.oiax.jp/rails/rspec_capybara_primer/let_and_fa...

Tweets

お盆休み中に新連載始めました。RSpec/Capybara入門。

お盆休み中に新連載始めました。RSpec/Capybara入門。

oiax.jp 19 Aug '13, 1am

Ruby on Railsプログラマーのための「RSpec/Capybara入門」を連載します。Railsを学習中の初心者がテスト駆動開発(TDD)あるいはビヘイビア駆動開発(BDD)を実践するための基礎的な知識や考え方を説明していきます。 メ...

Setup ruby on rails script by invertic

freelancer.com 24 Aug '13, 9am

Project Description: Hi. I need some help to setup a ruby on rail script. The script is ready but i get a 500 internal err...

China police who watched girl get stabbed to de...

singaporeseen.stomp.com.sg 25 Aug '13, 4am

Warning: The images and video in this article might be disturbing for some. User discretion is advised. This article was c...

User Authentication in Ruby on Rails by Marc Cl...

codeproject.com 24 Aug '13, 10am

I encounter a lot of Ruby/Rails code in which functionality is duplicated (copy and paste is dangerously easy in Ruby) and...

How to Create a Ruby on Rails blog in 99 second...

This is an intensive one-day overview video tutorial of the fundamental concepts of the Ruby on Rails Web programming fram...

Girl power in ancient Peru confirmed

Girl power in ancient Peru confirmed

channelnewsasia.com 23 Aug '13, 7am

LIMA, Peru: While history remembers men being in charge of civilisations, a new tomb discovery in Peru confirms that power...

Geekcamp Baguio Ruby on Rails Workshop

webgeek.ph 24 Aug '13, 12pm

Event: Geekcamp Baguio Ruby on Rails Workshop Date: September 7, 2013 Cost: Free Category: Others Organizer: Geekcamp Bagu...

Ruby on Rails Website Development in the West M...

uswebpros.com 24 Aug '13, 2am

Ruby on Rails is an open source web application framework and programming language. The Ruby on Rails web development tech...

From a monolithic Ruby on Rails app to the JVM ...

fr.slideshare.net 23 Aug '13, 8am

From a monolithic Ruby on Rails app to the JVM phil calçado @pcalcado http://philcalcado.com JDC2013 - CairoSunday, March ...