Coder Social home page Coder Social logo

jsgarvin / arid Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 234 KB

Ruby on Rails plugin providing methods for simple and DRY integration testing of conventions-compliant RESTful Rails applications.

Home Page: http://5valleys.com

License: MIT License

Ruby 100.00%

arid's Introduction

= ActiveResourceIntegrationDsl (ARID)

Provides a framework of common integration tests for RESTful CRUD interactions.

== Installation
script/plugin install git://github.com/jsgarvin/arid.git

== Sample Usage

	class ArticleTest < ActionController::IntegrationTest
	  include ActiveResourceIntegrationDsl
	  
	  def test_some_article_functionality
	  	new_session_as('jonnyg','testing123') do |jon|
	      params = {:article => {
	      		:title => 'Foo Bites Bar',
	      		:content => 'Bar was bitten by Foo yesterday.' 
	      }}
	      jon.builds_story(:params => params)
	      params = {:article => {:title => 'Bar Bitten Badly'}}
	      jon.edits_story(1,:params => params)
	      jon.lists_stories
	      jon.shows_story(1)
	      jon.destroys_story(1)
	    end
	  end
	end

== API
Complete API Documentation @
* Session Instantiation -- ActiveResourceIntegrationDsl  
* Session Methods -- ActiveResourceIntegrationDsl::SessionMethods


== License

Released under the MIT license.

== Author

* Jonathan Garvin ( http://www.5valleys.com )

== Assumptions
The plugin makes certain assumptions about your application.
Some of these can be bypassed or overridden if your app does
not conform.

* You have appropriate map.resources lines in your routes.rb
  for any controllers you intend to test with these methods.
* sessions_path helper method returns the path to a controller
  that controls user logins. (Provided automatically by
  Rails if you have a sessions_controller and routes.rb
  includes "map.resources :sessions".) 
* Your sessions controller accepts parameters in the form of...
  {:user => {:username => 'xxx', :password => 'yyy'}} Override
  by providing your own new_session_as method that generates
  an appropriate session for your app with the user provided.

arid's People

Contributors

aaron avatar jsgarvin avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

wwidea

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.