Use symbols to represent side

This commit is contained in:
Tim Kächele 2024-02-18 19:31:32 +01:00
parent 66044ddae1
commit 7278b77702
2 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ module Rex
when "order.create"
Messages::CreateOrderRequest.new(
nil,
parsed_message["args"]["side"],
parsed_message["args"]["side"].to_sym,
parsed_message["args"]["price"],
parsed_message["args"]["quantity"]
)

View File

@ -60,7 +60,7 @@ RSpec.describe Rex::Server::MessageParser do
it "returns a order create request" do
expect(subject).to be_instance_of(Rex::Server::Messages::CreateOrderRequest)
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.quantity).to eq(100)
end