This file contains hidden or 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
# api.rb | |
# | |
# Requirments: | |
# As a service resource | |
# I want to be able to make API requests in a consistent manner | |
# So that results are predicatble and easy to handle. | |
# | |
# Synopsis: | |
# This file sets up a Faraday engine to make HTTP requests with, | |
# and defines a number of helper methods to make API requests easy. |
This file contains hidden or 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
upstream unicorn { | |
server unix:/tmp/unicorn.inquest.sock fail_timeout=0; | |
} | |
server { | |
listen 80 default deferred; | |
root /home/inquest/inquest/public; | |
try_files $uri/index.html $uri @unicorn; | |
location @unicorn { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
This file contains hidden or 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
working_directory "/home/inquest/inquest" | |
pid "/home/inquest/inquest/tmp/pids/unicorn.pid" | |
stderr_path "/home/inquest/inquest/log/unicorn.log" | |
stdout_path "/home/inquest/inquest/log/unicorn.log" | |
listen "/tmp/unicorn.inquest.sock" | |
worker_processes 5 | |
timeout 30 | |
preload_app true |
This file contains hidden or 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
test: | |
host: localhost | |
adapter: postgresql | |
database: fishtale_test |
This file contains hidden or 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
# Short introduction may be blank, but may not be longer than 250 words | |
validates :short_introduction, length: {maximum: 250, tokenizer: -> (str) { str.scan(/\w+/) } } |
This file contains hidden or 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
before do | |
controller.instance_variable_set("@interactive_content_item", resource) | |
controller.stub(:set_interactive_content_item).and_return(true) | |
end |
This file contains hidden or 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
tire.search :page => params[:page] |
This file contains hidden or 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
ExampleController = ($scope, LocationService) -> | |
LocationService.locate().then (position) -> | |
$scope.position = position | |
ExampleController.$inject = ["$scope", "LocationService"] | |
YourAngularApp.controller("ExampleController", ExampleController) |
This file contains hidden or 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
describe "#perform" do | |
subject { -> { model.perform }.call } | |
it { expect { subject }.to change(Vehicle, :count).by(1) } | |
it { expect { subject }.to change(Registration, :count).by(1) } | |
it { expect { subject }.to change(AuditLog, :count).by(5) } | |
end |
This file contains hidden or 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
post :create, | |
splash_screen: { | |
image: Rack::Test::UploadedFile.new(Rails.root.join("spec/assets/example_splash_screen.jpg"), 'image/jpg') | |
} |