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
# inside Application controller | |
around_filter :global_request_logging | |
def global_request_logging | |
http_request_header_keys = request.headers.keys.select{|header_name| header_name.match("^HTTP.*")} | |
http_request_headers = request.headers.select{|header_name, header_value| http_request_header_keys.index(header_name)} | |
logger.info "Received #{request.method.inspect} to #{request.url.inspect} from #{request.remote_ip.inspect}. Processing with headers #{http_request_headers.inspect} and params #{params.inspect}" | |
begin | |
yield |
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 XXX < ActiveRecord::Base | |
before_validation :format_phone | |
validates_presence_of :phone | |
validates_length_of :phone, :is => 10 | |
attr_accessible :phone |
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
Feature: API | |
In order to use the service from third party apps | |
As a user | |
I want to be able to use an API | |
Background: | |
Given a user exists # Pickle | |
And I login as the user using basic auth | |
Scenario Outline: Get a ticket |
NewerOlder