Created
September 19, 2015 23:18
-
-
Save jonahgeorge/d0898cc3b5a00f40f291 to your computer and use it in GitHub Desktop.
Generates Capybara tests for the rails_admin index page for all models.
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
models = Dir.glob("*.rb") | |
def spec(model) | |
template = <<-END | |
scenario "#{model}" do | |
visit rails_admin.index_path(model_name: "#{model}") | |
page.status_code.must_equal 200 | |
page.assert_current_path rails_admin.index_path(model_name: "#{model}") | |
end | |
END | |
end | |
models.each do |model| | |
puts spec(model.gsub(".rb", "")) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment