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 Page | |
| # include ValidationsFor | |
| # | |
| # validations_for page_type: 'offer' do | |
| # validates :amount, presence: true | |
| # end | |
| # | |
| # validations_for page_type: 'page' do | |
| # validates :title, presence: 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
| /* | |
| * Tiny tokenizer | |
| * | |
| * - Accepts a subject string and an object of regular expressions for parsing | |
| * - Returns an array of token objects | |
| * | |
| * tokenize('this is text.', { word:/\w+/, whitespace:/\s+/, punctuation:/[^\w\s]/ }, 'invalid'); | |
| * result => [{ token="this", type="word" },{ token=" ", type="whitespace" }, Object { token="is", type="word" }, ... ] | |
| * | |
| */ |
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
| import Ember from 'ember'; | |
| import hbs from 'htmlbars-inline-precompile'; | |
| import connect from 'ember-redux/components/connect'; | |
| var stateToComputed = (state) => { | |
| return { | |
| number: state.number | |
| }; | |
| }; |
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
| source 'https://rubygems.org' | |
| gem 'mechanize' |
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
| <comment-box> | |
| <h1>{ opts.title }</h1> | |
| <comment-list url={ opts.url } comments={ comments } /> | |
| <comment-form url={ opts.url } /> | |
| this.comments = [] | |
| add(comment) { | |
| this.comments.push(comment) |
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_helper.rb | |
| require 'rspec' | |
| require 'watir-webdriver' | |
| require 'page-object' | |
| require 'page-object/page_factory' | |
| require 'require_all' | |
| require_all 'lib/pages' | |
| RSpec.configure do |config| |
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
| # Call scopes directly from your URL params: | |
| # | |
| # @products = Product.filter(params.slice(:status, :location, :starts_with)) | |
| module Filterable | |
| extend ActiveSupport::Concern | |
| module ClassMethods | |
| # Call the class methods with the same name as the keys in <tt>filtering_params</tt> | |
| # with their associated values. Most useful for calling named scopes from |
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
| module CapybaraWithPhantomJs | |
| include Capybara | |
| # Create a new PhantomJS session in Capybara | |
| def new_session | |
| # Register PhantomJS (aka poltergeist) as the driver to use | |
| Capybara.register_driver :poltergeist do |app| | |
| Capybara::Poltergeist::Driver.new(app) | |
| 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
| .fc { | |
| direction: ltr; | |
| text-align: left; } | |
| .fc table { | |
| border-collapse: collapse; | |
| border-spacing: 0; } | |
| .fc .btn { | |
| line-height: 1.2em; } | |
| html .fc { |
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
| # config/locales/en.yml | |
| en: | |
| errors: | |
| messages: | |
| wrong_size: "is the wrong size (should be %{file_size})" | |
| size_too_small: "is too small (should be at least %{file_size})" | |
| size_too_big: "is too big (should be at most %{file_size})" |
NewerOlder