Skip to content

Instantly share code, notes, and snippets.

@dipesh-p
dipesh-p / gist:2319177
Created April 6, 2012 11:58
spec_helper.rb
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
#require File.expand_path("../factories", __FILE__)
#require File.join(Rails.root,'spec','factories','factories.rb')
require 'factory_girl_rails'
require 'capybara/rspec'
require 'capybara/rails'
@dipesh-p
dipesh-p / gist:2319172
Created April 6, 2012 11:56
food_categories_spec.rb
require 'spec_helper'
describe "FoodCategories" do
before :each do
establishment = Establishment.create(:name => 'Havmor')
@user = User.create(:email => 'user@example.com', :password => 'password', :establishment_id => establishment.id, :is_establishment_admin => true)
end
before do