Code Monkey home page Code Monkey logo

banksimplistic's Issues

config.to_prepare in infrastructure.rb create new driver object

Hi dude.

It seams like the config.to_prepare block in infrastructure.rb is causing me some problem when I run the rake task to subscribe on events from the amqp driver.

config.to_prepare do
Eventwire.driver = Rails.env.test? ? 'InProcess' : 'AMPQ'
end

It run the following code in eventwire.rb

def self.driver=(driver)
klass = Drivers.const_get(driver.to_sym) if driver.respond_to?(:to_sym)
@driver = klass ? klass.new : driver
end

that re-sets the @driver object. I loose the values in the object variable @subscriptions in the driver that the subscriber method already setup.

I made a work around by remove the config.to_prepare block and run the code directly. Works in my case but dont know if it's a solid solution.

New clients not being persisted

Thanks so much for this project, it's really helped me get my head around this pattern.

I run up a server and start the event bus (btw - be nice to have the event bus rake task in the README). I create new clients, but they don't persist attributes properly:

> ClientReport.all.each {|x| puts x.inspect }
#<ClientReport:3 name=nil city=nil uid=nil>
#<ClientReport:4 name=nil city=nil uid=nil>
#<ClientReport:5 name=nil city=nil uid=nil>
#<ClientReport:1 name=nil city=nil uid=nil>
#<ClientReport:2 name=nil city=nil uid=nil>
 => ["3", "4", "5", "1", "2"] 

This is also reflected in the test failures:

Failures:

  1) Create client In order to start selling other services
  As a banker
  I want to sign up new clients New user sign up
     Failure/Error: click_button "Create client!"
     ActionView::Template::Error:
       No route matches {:action=>"destroy", :controller=>"clients"}
     # ./app/views/clients/index.html.erb:13:in `block in _app_views_clients_index_html_erb___1869135361368763010_2166995120_383953378302977591'
     # ./app/views/clients/index.html.erb:9:in `_app_views_clients_index_html_erb___1869135361368763010_2166995120_383953378302977591'
     # <internal:prelude>:10:in `synchronize'
     # ./spec/acceptance/acceptance_helper.rb:25:in `block in <top (required)>'
     # ./spec/acceptance/create_client_spec.rb:19:in `block (2 levels) in <top (required)>'

  2) Feature name In order to do evil thing with their money
  As a banker
  I want clients to open accounts Client opens a new account
     Failure/Error: Unable to find matching line from backtrace
     NoMethodError:
       undefined method `accounts' for nil:NilClass
     # ./app/reports/client_details_report.rb:31:in `block in <class:ClientDetailsReport>'
     # ./app/infrastructure/event_handler.rb:7:in `call'
     # ./app/infrastructure/event_handler.rb:7:in `block (2 levels) in on'
     # ./app/infrastructure/event_bus.rb:62:in `call'
     # ./app/infrastructure/event_bus.rb:62:in `block (3 levels) in start'
     # ./app/infrastructure/event_bus.rb:61:in `block (2 levels) in start'
     # ./app/infrastructure/event_bus.rb:58:in `start'
     # ./app/infrastructure/event_bus.rb:4:in `start'
     # ./spec/acceptance/acceptance_helper.rb:12:in `block (3 levels) in <top (required)>'

  3) Send Money Transfer In order for money to circulate  
  As a banker
  I want my clients to send money transfers to other accounts Send money transfer to an internal account
     Failure/Error: page.should have_content "Balance: $0"
       expected #has_content?("Balance: $0") to return true, got false
     # ./spec/acceptance/send_money_transfer_spec.rb:27:in `block (2 levels) in <top (required)>'

Finished in 3.21 seconds
11 examples, 3 failures

(the top one is a result of trying to render a client with a nil uid, which should never happen)

Perhaps this is a version issue with redis/ruby redis library? I don't really know anything about it. I have redis v2.0.4.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.