Use symbols to represent side
This commit is contained in:
parent
66044ddae1
commit
7278b77702
@ -30,7 +30,7 @@ module Rex
|
|||||||
when "order.create"
|
when "order.create"
|
||||||
Messages::CreateOrderRequest.new(
|
Messages::CreateOrderRequest.new(
|
||||||
nil,
|
nil,
|
||||||
parsed_message["args"]["side"],
|
parsed_message["args"]["side"].to_sym,
|
||||||
parsed_message["args"]["price"],
|
parsed_message["args"]["price"],
|
||||||
parsed_message["args"]["quantity"]
|
parsed_message["args"]["quantity"]
|
||||||
)
|
)
|
||||||
|
@ -60,7 +60,7 @@ RSpec.describe Rex::Server::MessageParser do
|
|||||||
it "returns a order create request" do
|
it "returns a order create request" do
|
||||||
expect(subject).to be_instance_of(Rex::Server::Messages::CreateOrderRequest)
|
expect(subject).to be_instance_of(Rex::Server::Messages::CreateOrderRequest)
|
||||||
expect(subject.user_id).to eq(nil)
|
expect(subject.user_id).to eq(nil)
|
||||||
expect(subject.side).to eq("buy")
|
expect(subject.side).to eq(:buy)
|
||||||
expect(subject.price).to eq(10)
|
expect(subject.price).to eq(10)
|
||||||
expect(subject.quantity).to eq(100)
|
expect(subject.quantity).to eq(100)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user