This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unicorn@urano:~$ sm --trace unicorn service setup | |
/opt/sm/sets/active/ruby/unicorn/shell//functions: line 5: typeset: -g: invalid option | |
typeset: usage: typeset [-aAfFilrtux] [-p] name[=value] ... | |
A command has returned error code '(2)' without being handled. | |
+# source file # function() | |
===================================================================================================================================================================================== | |
less +5 /opt/sm/sets/active/ruby/unicorn/shell//functions # unicorn_initialize() | |
less +130 /opt/sm/core/sm/shell/modules/functions # __sm.module.include() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# language: pt | |
Funcionalidade: Exibição de Relatório Mensal | |
Para efetuar o download o relatório do Setor de Suporte ao Usuário | |
Como qualquer usuário (autênticado ou não) | |
Eu quero visualizar e navegar entre ós relatórios de cada mês | |
Contexto: | |
Dado que eu tenho os seguintes relatórios: | |
| year | month | report_file_name | | |
| 2010 | 1 | 1-2010.pdf | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class KidsController < ApplicationController | |
crud_for :kid | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module CrudFor | |
def crud_for(model) | |
expose(model.to_sym) | |
expose(model.to_s.pluralize.to_sym) { search.paginate(:page => params[:page]) } | |
expose(:search) { model.to_s.capitalize.constantize.search(params[:search]) } | |
self.class_eval %" | |
def create | |
if #{model}.save | |
redirect_to #{model.to_s.pluralize}_url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Single-line step scoper | |
Quando /^(.*) dentro de ([^:]+)$/ do |step, parent| | |
with_scope(parent) { Quando step } | |
end | |
# Multi-line step scoper | |
Quando /^(.*) dentro de ([^:]+):$/ do |step, parent, table_or_string| | |
with_scope(parent) { Quando "#{step}:", table_or_string } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Funcionalidade: Gerenciamento de Símbolos | |
Para efetuar o gerenciamento de símbolos | |
Como um usuário | |
Eu quero cadastrar, alterar e excluir símbolos | |
Cenário: Listagem | |
Dado que eu tenho símbolos chamados CIT-6, SIM-1 | |
Quando eu vou para listagem de símbolos | |
Então eu devo ver "CIT-6" | |
E eu devo ver "SIM-1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JobSymbolsController < ApplicationController | |
expose(:job_symbol) | |
expose(:job_symbols) { search.paginate(:page => params[:page]) } | |
expose(:search) { JobSymbol.search(params[:search]) } | |
def index | |
end | |
def new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe JobSymbolsController do | |
before do | |
JobSymbol.stub!(:new).and_return(@job_symbol = mock_model(JobSymbol)) | |
JobSymbol.stub!(:search).and_return(@search = []) | |
@search.stub!(:paginate).and_return(@job_symbols = []) | |
@request_params = { :search => Hash.new, :page => 10, :job_symbol => {} } | |
@job_symbol.stub!(:attributes=) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JobSymbolsController < ApplicationController | |
expose(:job_symbol) | |
expose(:job_symbols) { search.paginate(:page => params[:page]) } | |
expose(:search) { JobSymbol.search(params[:search]) } | |
def create | |
if job_symbol.save | |
redirect_to(job_symbols_url) | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FloorsController < ApplicationController | |
load_and_authorize_resource | |
expose(:floor) | |
expose(:floors) { search.paginate(:page => params[:page]) } | |
expose(:search) { Floor.search(params[:search]) } | |
def create | |
if floor.save |