Test Active Admin resources in your application.
The gem extracts all Active Admin resources, creates the instances using factory_girl, and executes :index, :show, :edit actions for each resource.
Add this line to your application's Gemfile:
gem "test_active_admin", :git => "git://github.com/BrandyMint/test_active_admin.git"
And then execute:
*_spec.rb file (ex.
requests group of specs
Define Active Admin tests in
require 'spec_helper' require 'test_active_admin' # define active admin tests test_active_admin do |config| config.before do # code to be executed before each resource test stub_some_things end config.login do # code to login to active admin @admin_user = FactoryGirl.create(:admin_user) visit '/admin' fill_in 'admin_user_email', :with => @admin_user.email fill_in 'admin_user_password', :with => @admin_user.password click_button 'Login' end end
active_admin_spec.rb contains Capybara tests that can be runned.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request