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 "test_helper" | |
| describe TornamentsController do | |
| let(:tornament) { tornaments :one } | |
| it "gets index" do | |
| get :index | |
| assert_response :success | |
| assert_not_nil assigns(:tornaments) |
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 "test_helper" | |
| describe TornamentsController do | |
| let(:tornament) { tornaments :one } | |
| it "gets index" do | |
| get :index | |
| assert_response :success | |
| assert_not_nil assigns(:tornaments) |
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 TornamentsController < ApplicationController | |
| before_action :authenticate_user!, only: [:new, :edit, :update, :destroy] | |
| before_action :set_tornament, only: [:show, :edit, :update, :destroy] | |
| respond_to :html | |
| def index | |
| @tornaments = Tornament.all | |
| respond_with(@tornaments) | |
| 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
| class Reaction | |
| def initialize(yield_to) | |
| self.yield_to = yield_to | |
| end | |
| def method_missing(method_name, *) | |
| if yieldable?(method_name) | |
| yield if block_given? | |
| end | |
| 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
| # From http://blog.boochtek.com/2015/02/23/hexagonal-rails-controllers | |
| class OrderController < ApplicationController | |
| def index | |
| interactor.on(:display) { |orders| render orders } | |
| interactor.list | |
| end | |
| def show | |
| interactor.on(:display) { |order| render order } |
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
| // | |
| // ViewController.swift | |
| // Airport | |
| // | |
| // Created by Amos King on 3/22/16. | |
| // Copyright © 2016 Binary Noggin. All rights reserved. | |
| // | |
| import UIKit |
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
| # == Schema Information | |
| # | |
| # Table name: cached_open_items | |
| # | |
| # id :integer not null, primary key | |
| # company_id :integer not null | |
| # project_id :integer | |
| # login_information_id :integer not null | |
| # open_item_id :integer not null | |
| # open_item_type :string(255) not null |
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 PasswordFormatValidator < ActiveModel::EachValidator | |
| def validate_each(record, attr_name, value) | |
| PasswordValidationRules.new(value).errors.each do |error| | |
| record.errors.add(attr_name, error) | |
| end | |
| #if value != record.password_confirmation | |
| #record.errors.add(:password_confirmation, I18n.t('views.project.flash_messages.password_does_not_match_confirmation')) | |
| #end | |
| end | |
| 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
| - if @changeset.action do | |
| .alert.alert-danger | |
| %p | |
| Oops, something isn't quite right. Please correct the errors below. | |
| = form_for @changeset, registration_path(@conn, :create), fn(f) -> | |
| .form-group | |
| = text_input f, :email, placeholder: "Name", class: "form-control" | |
| = error_tag f, :email | |
| .form-group |
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 "rspec" | |
| RSpec.describe "before after" do | |
| before do | |
| raise "failed" | |
| end | |
| after do | |
| puts "hey" | |
| end |