Skip to content

Commit

Permalink
test message
Browse files Browse the repository at this point in the history
  • Loading branch information
classicalliu committed Aug 2, 2018
1 parent 45a20cd commit 0280738
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ DEPENDENCIES
puma (~> 3.11)
rack-cors
rails (~> 5.2.0)
rake (~> 12.3, >= 12.3.1)
ransack (~> 1.8, >= 1.8.8)
rspec-rails (~> 3.7)
sass-rails (~> 5.0)
Expand Down
30 changes: 30 additions & 0 deletions spec/models/message_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
require 'rails_helper'

RSpec.describe Block, type: :model do
let(:content) { "0x0a770a28636235313466303134313761626366626431663632393961306434313961326430656165613362361220323066613965333731663531343062613862656533333632313735396338343718e80720db8512322000000000000000000000000000000000000000000000000000000000000010003801124113ec0f1aba3247937c069d250faa708f53162b2a8059597f3df4d1a74ff1c2214eb6251e4bb336a2cc3b6c432fe1e0c79ba9d464fdd8ab8eb525cb2ac93c8a7500" }
let(:from) { "0xee01b9ba97671e8a1891e85b206b499f106822a1" }
let(:from_pubkey) { "0x502c3fcf093f3f14d34d1eea42d8740d5caa793ede97fea257306530cb0ecd032d5abcdc96dc198c1eebe4e55bbba059e338671b603160a30ca34fe361917f71" }
let(:to) { "0xcb514f01417abcfbd1f6299a0d419a2d0eaea3b6" }
let(:quota) { 1000 }
let(:value) { "0x0000000000000000000000000000000000000000000000000000000000001000" }
let(:message) { Message.new(content) }
let(:unverified_transaction) { message.unverified_transaction }
let(:transaction) { unverified_transaction["transaction"] }

it "quota should be 1000" do
expect(transaction["quota"]).to eq quota
end

it "value should be eq" do
expect(message.value).to eq value
end

it "from should be eq" do
expect(message.from).to eq from
end

it "to should be eq" do
expect(message.to).to eq to
end

end

0 comments on commit 0280738

Please sign in to comment.