Skip to content

Commit

Permalink
Removing these specs. They've been added directly in to Avram. Ref: c…
Browse files Browse the repository at this point in the history
…omments on #1287 (#1293)
  • Loading branch information
jwoertink authored Oct 28, 2020
1 parent cbd05b9 commit 5698644
Showing 1 changed file with 0 additions and 74 deletions.
74 changes: 0 additions & 74 deletions spec/lucky/params_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,6 @@ require "../spec_helper"
include ContextHelper
include MultipartHelper

private class TestOperationWithDefaultParamKey < Avram::Operation
attribute title : String

def run
end
end

private class TestOperationWithCustomParamKey < Avram::Operation
param_key :test_op
attribute title : String

def run
end
end

private class User < Avram::Model
table do
column name : String
end
end

private class SaveUser < User::SaveOperation
end

describe Lucky::Params do
describe "#from_query" do
it "returns the HTTP::Params for the query params" do
Expand Down Expand Up @@ -622,54 +598,4 @@ describe Lucky::Params do
params.should eq({"filter" => {"name" => "euphonium"}, "page" => "1", "per" => "50"})
end
end

describe "#has_key_for?" do
it "returns true for the Operation with the proper key" do
request = build_request body: "", content_type: ""
request.query = "test_operation_with_default_param_key:title=Test"
params = Lucky::Params.new(request)

params.has_key_for?(TestOperationWithDefaultParamKey).should be_true
end

it "returns true for the Operation with a custom key" do
request = build_request body: "", content_type: ""
request.query = "test_op:title=Test"
params = Lucky::Params.new(request)

params.has_key_for?(TestOperationWithCustomParamKey).should be_true
end

it "returns false for the Operation with the improper key" do
request = build_request body: "", content_type: ""
request.query = "bad_key:title=Test"
params = Lucky::Params.new(request)

params.has_key_for?(TestOperationWithDefaultParamKey).should be_false
end

it "returns false for the Operation with no key" do
request = build_request body: "", content_type: ""
request.query = "title=Test"
params = Lucky::Params.new(request)

params.has_key_for?(TestOperationWithDefaultParamKey).should be_false
end

it "returns true for the SaveOperation with the proper key" do
request = build_request body: "", content_type: ""
request.query = "user:name=Test"
params = Lucky::Params.new(request)

params.has_key_for?(SaveUser).should be_true
end

it "returns false for the SaveOperation with the improper key" do
request = build_request body: "", content_type: ""
request.query = "author:name=Test"
params = Lucky::Params.new(request)

params.has_key_for?(SaveUser).should be_false
end
end
end

0 comments on commit 5698644

Please sign in to comment.