🏃♀️
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
| # spec/support/site_prism/user_page.rb | |
| class UserPage | |
| class FormBase < SitePrism::Section | |
| element :first_name, "input[name='user[first_name]']" | |
| element :last_name, "input[name='user[last_name]']" | |
| element :button, "input[name='commit']" | |
| def input(args) | |
| first_name.set args[:first_name] | |
| last_name.set args[:last_name] | |
| button.click |
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
| # model | |
| serialize :body | |
| # controller | |
| def inquiry_params | |
| params.require(:inquiry).permit(:read_at, :inquiry_form_id, inquiry_contents_attributes: [{body: []}, :part_id]) | |
| 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
| require 'spec_helper' | |
| describe MyModel do | |
| it "should create a new instance given valid attributes" do | |
| Factory(:my_model) | |
| end | |
| describe "name" do | |
| it "should be required" do | |
| blank = Factory.build(:my_model, :name => "") |
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
| class Facebook::Notification | |
| attr_accessor :canvas_auth, :graph | |
| def initialize | |
| conf = Rails.configuration.facebook_canvas | |
| @canvas_auth = Koala::Facebook::OAuth.new(conf[:app_id], conf[:app_secret]) | |
| @graph = Koala::Facebook::API::new(canvas_auth.get_app_access_token, conf[:app_secret]) | |
| 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
| str = '' | |
| yaml_test = str.to_yaml | |
| =>"--- \"\"\n" | |
| YAML.load(yaml_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
| require 'zeus/rails' | |
| class CustomPlan < Zeus::Rails | |
| def server Dir.chdir(::Rails.application.root) | |
| `unicorn_rails` | |
| end | |
| end | |
| Zeus.plan = CustomPlan.new |
NewerOlder