You need to update circle.yml:
machine:
node: # add node dependency
version:
7.4
environment:
# SSL self signed localhost for rails start to finish, no red warnings. | |
# 1) Create your private key (any password will do, we remove it below) | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
require 'spec_helper' | |
# Based on https://github.com/rails/ssl_requirement/blob/master/lib/ssl_requirement.rb | |
class SslRequirement | |
def initialize(app, options= {}) | |
@app = app | |
@allowed = options[:allowed] | |
@required = options[:required] | |
end | |
before_action :cors_preflight_check | |
after_action :cors_set_access_control_headers | |
def cors_set_access_control_headers | |
headers['Access-Control-Allow-Origin'] = '*' | |
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT' | |
headers['Access-Control-Max-Age'] = "1728000" | |
end | |
def cors_preflight_check |
#Palindrome a word phrase that reads the same backwards | |
# write code that will return true for the following palindrome | |
# "A man, a plan, a canal: Panama" | |
module Palindrome | |
def self.is_palindrome(word) | |
end | |
end | |
# Palindrome.is_palindrome("A man, a plan, a canal: Panama") => true |
## Most important settings
Create a new facebook app (1) and make sure the canvas url (2) in the basic tab matches the host and port configured with Capybara.server_port and Capybara.app_host. Activating sandbox mode (3) in the advanced tab enables you to roll without providing an SSL canvas url. You want to set the display mode (4) of your facebook dialogs to page, which is also the default.
ENV["RAILS_ENV"] = "test" | |
require File.expand_path("../../config/environment", __FILE__) | |
require "minitest/autorun" | |
require "capybara/rails" | |
require "active_support/testing/setup_and_teardown" | |
Dir[Rails.root.join("test/support/**/*.rb")].each {|f| require f} | |
DatabaseCleaner.strategy = :truncation |
Look at the following image...
...it shows an object being tested.
You can't see inside the object. All you can do is send it messages. This is an important point to make because we should be "testing the interface, and NOT the implementation" - doing so will allow us to change the implementation without causing our tests to break.
## | |
# This files shows some possible implementations of the Singleton pattern | |
# in Ruby. I'm not a huge fan of the Singleton pattern, but it's nice | |
# in some cases. In this file I'm going to implement a simple logger. | |
# | |
## | |
# The first implementation that can come to our minds is to create a class | |
# that holds an instance as a class variable that can be accessed through |
<%= semantic_form_for @parent do |a| %> | |
<%= a.inputs "Family Details" do %> | |
<%= a.input :name %> | |
<%= a.input :user %> | |
<%= a.input :region %> | |
<% end %> | |
<%= a.inputs "Children" do %> | |
<table> |