Last active
August 29, 2015 13:57
-
-
Save renaehodgkins/9367955 to your computer and use it in GitHub Desktop.
testing activeadmin controller example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe Admin::ArtifactsController, type: feature do | |
render_views | |
before(:each) do | |
@user = create(:user) | |
@admin_user = AdminUser.create(email: "[email protected]", password: "123SuperTest") | |
@artifact = create(:artifact) | |
end | |
describe "Artifact index" do | |
before(:each) do | |
@artifact.request_digitization(@user) | |
end | |
it "shows the artifact in the index" do | |
visit admin_artifacts_path | |
fill_in 'admin_user_email', :with => @admin_user.email | |
fill_in 'admin_user_password', :with => @admin_user.password | |
click_button 'Login' | |
expect(page).to have_content(@artifact.solr_document_id) | |
end | |
end | |
end |
I think it isn't showing up highlighted (and with 8-space indentation) b/c github can't tell it's a ruby file.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Might be helpful to note that the spec is placed in the spec/controllers/admin/ directory