Sha256: 2d1a216c3f08c900e7ded6f4031216452b5d3632b423783122c0cae1b7a0f99f

Contents?: true

Size: 761 Bytes

Versions: 6

Compression:

Stored size: 761 Bytes

Contents

require 'spec_helper'

describe TerminalPingsController do
  before(:all) do
    @agent    = Agent.create!(:title => 'test')
    @terminal = Terminal.make!(:keyword => 'test', :agent => @agent)
  end

  it "creates" do
    post :create, :terminal => 'foobar'
    response.status.should == 404

    post :create, :terminal => 'test', :terminal_ping => {
      :banknotes => {
        '10' => '14',
        '1000' => '1'
      },
      :ip => '127.0.0.1',
      :cash_acceptor => {
        'error' => '-1'
      },
      :providers => {
        :updated_at => DateTime.now,
        :ids => [1, 2, 3]
      }
    }
    @terminal.pings.count.should == 1
    @terminal.pings.first.cash_sum.should == 1140
    @terminal.pings.first.ip.should == '127.0.0.1'
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
smartkiosk-server-0.10.1 spec/controllers/terminal_pings_controller_spec.rb
smartkiosk-server-0.10.0 spec/controllers/terminal_pings_controller_spec.rb
smartkiosk-server-0.9.3 spec/controllers/terminal_pings_controller_spec.rb
smartkiosk-server-0.9.2 spec/controllers/terminal_pings_controller_spec.rb
smartkiosk-server-0.9.1 spec/controllers/terminal_pings_controller_spec.rb
smartkiosk-server-0.9.0 spec/controllers/terminal_pings_controller_spec.rb