Module: Neo::Rails::Scenarios

Extended by:
ActiveSupport::Concern
Defined in:
lib/neo/rails/scenarios.rb,
lib/neo/rails/scenarios/test_helper.rb,
lib/neo/rails/scenarios/rails_helper.rb

Overview

Enables controller actions to have scenarios, which will be applied before the execution of the action.

Defined Under Namespace

Modules: ClassMethods, RailsHelper, TestHelper Classes: DuplicatedScenario, ExposureMustBeIncludedFirst, Scenario

Instance Method Summary collapse

Instance Method Details

#expose(name, value = nil) ⇒ Object

Overwrites expose so it will only set the value once. see Neo::Rails::Exposure



61
62
63
64
65
66
67
# File 'lib/neo/rails/scenarios.rb', line 61

def expose(name, value=nil)
  if exposed?(name)
    # nothing as set already via mock
  else
    super
  end
end

#list_scenariosObject

List all defined scenarios

Return an Array of scenario objects



72
73
74
# File 'lib/neo/rails/scenarios.rb', line 72

def list_scenarios
  self.class.list_scenarios
end