Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## stories/all.rb: [ruby]
- $LOAD_PATH.unshift File.dirname(__FILE__)
- require 'helper'
- with_steps_for :data, :auth, :browsing, :parsing, :debug do
- Dir['stories/text/**/*'].select { |x| File.file?(x) }.each do |story_path|
- run story_path, :type => RailsStory
- end
- # or be explicit:
- # run "stories/text/logging_in"
- end
- ## stories/helper.rb: [ruby]
- ENV["RAILS_ENV"] = "test"
- require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
- require 'spec'
- require 'spec/rails/story_adapter'
- require 'hpricot'
- Dir['stories/steps/**/*.rb'].each do |steps_file|
- require steps_file
- end
- ## stories/steps/data.rb: [ruby]
- steps_for(:data) do
- Given("a user with $privileges privileges") do |privileges|
- user = User.create!(:first_name => 'Example', :last_name => 'User', :email => 'user@example.com', :password => 'password')
- case privileges
- when 'admin' then user.admin = true
- when 'fundraising' then user.fundraising_account = true
- end
- user.save!
- @current_user = user
- end
- end
Add Comment
Please, Sign In to add comment