Monday, May 16, 2011

How to create create RSpec helper and share.

Create RSpec helper method and share in all specs if you need.
*RSpec ver 1.3x

Create helper
module UserHelpers
  def user_helper_method
     #do something
  end
end

describe User
  include UserHelpers
  .
  .
  .
end
Share in all specs
RSpec.configure do |config|
  config.include(UserHelpers)
end

No comments:

Post a Comment