Skip to content

Instantly share code, notes, and snippets.

@satoshin2071
Last active December 12, 2015 06:19
Show Gist options
  • Save satoshin2071/4728216 to your computer and use it in GitHub Desktop.
Save satoshin2071/4728216 to your computer and use it in GitHub Desktop.
rails2.3.14 rspec test sample
Rails 2.x
Install rspec and rspec-rails plugins for Rails >= 2.1.0
% ruby script/plugin install git://github.com/dchelimsky/rspec.git -r 'refs/tags/1.2.9'
% ruby script/plugin install git://github.com/dchelimsky/rspec-rails.git -r 'refs/tags/1.2.9'
% ruby script/generate rspec
% rake db:migrate RAILS_ENV=test
% cd ./spec
% mkdir ./models
% vim ./models/serialnumber_spec.rb
require 'spec_helper'
describe Serialnumber, "Creates a new"do
before(:each) do
@serialnumber = Serialnumber.new()
end
it "test description" do
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment