Work smart, not strong. This gem gives developers an easy to understand and easy to maintain schema for request parameters. Meant as a drop-in replacement for strong_params.
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
# NOTE: Each task is a map function wrapped in a HOC for handling the return data. | |
# The annotation of each task is `state -> mixed | state | exception` and the HOC is | |
# `state -> (state -> mixed | exception) -> state`. `error` is like a task, but instead: | |
# `exception -> mixed` wrapped in a HOC that matches `exception -> (exception -> mixed) -> exception`. | |
class AddToCartOperation < ApplicationOperation | |
task :check_for_missing_product | |
task :carbon_copy_cart_item | |
task :lock | |
task :persist |
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 "set" | |
require "rspec/autorun" | |
GRAPH = Hash.new { |accumulated, key| accumulated[key] = Set.new} | |
LIBRARIES = Set.new | |
def depend(subject, *dependencies) | |
GRAPH[subject].merge(dependencies) | |
dependencies.each(&GRAPH.method(:[])) | |
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
SmartParams | |
returns as json (FAILED - 1) | |
Failures: | |
1) SmartParams returns as json | |
Failure/Error: | |
expect( | |
CreateAccountSchema.new({ | |
data: { |
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
export {default as updateInput} from "./updateInput" | |
export {default as submitAccount} from "./submitAccount" |
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
/usr/local/Cellar/ruby/2.5.0/bin/ruby -I/usr/local/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib:/usr/local/lib/ruby/gems/2.5.0/gems/rspec-support-3.7.1/lib /usr/local/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/exe/rspec --pattern lib/\*\*\{,/\*/\*\*\}/\*_spec.rb | |
JSONAPI::Realizer::Action::Create | |
#call | |
with a good payload and good headers | |
creates a model (FAILED - 1) | |
Failures: | |
1) JSONAPI::Realizer::Action::Create#call with a good payload and good headers creates a model |
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
:root { | |
--blue: #007bff; | |
--indigo: #6610f2; | |
--purple: #6f42c1; | |
--pink: #e83e8c; | |
--red: #dc3545; | |
--orange: #fd7e14; | |
--yellow: #ffc107; | |
--green: #28a745; | |
--teal: #20c997; |
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
development main · > PUBNUB_POWERSELLER.publish(channel: "test", message: "test") | |
fatal: No live threads left. Deadlock? | |
2 threads, 2 sleeps current:0x00007faf668c0180 main thread:0x00007faf64e06580 | |
* #<Thread:0x00007faf6587eee0 sleep_forever> | |
rb_thread_t:0x00007faf64e06580 native:0x00007fffab4b4340 int:0 | |
/Users/kurtis.rainboltgreene/.rvm/gems/ruby-2.4.3@sneakers/gems/celluloid-0.17.3/lib/celluloid/mailbox.rb:63:in `sleep' | |
/Users/kurtis.rainboltgreene/.rvm/gems/ruby-2.4.3@sneakers/gems/celluloid-0.17.3/lib/celluloid/mailbox.rb:63:in `wait' | |
/Users/kurtis.rainboltgreene/.rvm/gems/ruby-2.4.3@sneakers/gems/celluloid-0.17.3/lib/celluloid/mailbox.rb:63:in `block in check' | |
/Users/kurtis.rainboltgreene/.rvm/gems/ruby-2.4.3@sneakers/gems/timers-4.1.2/lib/timers/wait.rb:15:in `block in for' | |
/Users/kurtis.rainboltgreene/.rvm/gems/ruby-2.4.3@sneakers/gems/timers-4.1.2/lib/timers/wait.rb:14:in `loop' |
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 "Some HTTP Request" do | |
before do | |
get "http://example.com" | |
end | |
it "is successful" do | |
expect(response).to have_http_status(:ok) | |
end | |
it "increments the visitor counter" do |