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 Elders | |
class StaleFinder | |
class << self | |
def call | |
build | |
end | |
private | |
def build |
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 UserStocksController < ApplicationController | |
def create | |
@user_stock = UserStocksCreator.new(current_user, params, flash).call | |
redirect_to my_portfolio_path | |
end | |
def destroy | |
UserStocksDestroyer.new(current_user, params, flash).call | |
redirect_to my_portfolio_path | |
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
RSpec.describe AddAnswerToQuestion do | |
subject { described_class.new(questionnaire: questionnaire, question: question, answer: answer).call } | |
let(:questionnaire) { create(:questionnaire) } | |
let(:question) { create(:question) } | |
let(:answer) { create(:answer) } | |
context "when question is linked to the questionnaire" do | |
before { add_question_to_questionnaire(questionnaire, question) } | |
it { expect { subject }.not_to raise_error } |
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
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
NewerOlder