Fakecrm

TODO: Write a gem description

Installation

Add this line to your application's Gemfile:

gem 'fakecrm', :git => [email protected]:infopark/fakecrm.git

And then execute:

$ bundle

Usage

You can run this gem as standalone server with:

$ fakecrm

For help on running this command execute:

$ fakecrm --help

Another approach is to embed fakecrm directly into your application. The following describes steps neccessary for a rails application.

Assuming you added fakecrm to your application's Gemfile, you need to create an initializer, for example under config/initializers/fakecrm.rb:

# place your Fakecrm configuration here
Fakecrm::Configuration.silent = true

Infopark::Crm.configure do |configuration|
  configuration.url = "http://localhost:#{Fakecrm::Configuration.port}/crm"
  configuration. = "root"
  configuration.api_key = "deadbeef"
end

require 'fakecrm/embedded'
Fakecrm.embedded! if Rails.env.development? || Rails.env.test?

For available configuration options see the output of the command:

$ fakecrm --help

Notes

Handling attachements is unsupported at the moment.

Testing

To prepare test environment execute (you must only do it once):

$ git submodule init
$ git submodule update

Execute to update test environment:

$ git submodule update

Execute this line to run all tests:

$ rake

Open coverage/index.html after running the suite to see a detailed report of code coverage.

You can also run only selected test using:

$ TEST=test/crm_connector/account_search_custom_field_test.rb rake

Some bugs only become apparent after the suite has been run two consecutive times. To handle this case execute:

$ rake TWICE=1

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request