Class: Embryo::RubyTemplate::Action::Show

Inherits:
Embryo::RubyTemplate::Action show all
Defined in:
lib/rails-embryo/ruby_template/action/show.rb

Instance Method Summary collapse

Methods inherited from Embryo::RubyTemplate::Action

#initialize

Methods inherited from Embryo::RubyTemplate

#text

Constructor Details

This class inherits a constructor from Embryo::RubyTemplate::Action

Instance Method Details

#controller_method_codeObject



5
6
7
# File 'lib/rails-embryo/ruby_template/action/show.rb', line 5

def controller_method_code
  method_code :show
end

#controller_spec_codeObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/rails-embryo/ruby_template/action/show.rb', line 9

def controller_spec_code
  spec_group_code "#show",
    spec_before_code(
      "@#{model.singular} = create :#{model.symbol}",
      "get :show, id: @#{model.singular}.id"),
    spec_code("assigns the widget",
      "expect(assigns :#{model.singular}).to eq @#{model.singular}"),
    spec_code("succeeds",
      "expect(response).to be_success")
end