Created
May 18, 2011 21:17
-
-
Save mkoby/979586 to your computer and use it in GitHub Desktop.
Typus Redirecting On Tests
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
<html> | |
<body> | |
You are being <a href="http://test.host/admin/session/new?back_to=%2Fadmin%2Fcredits%2Fnew">redirected</a>. | |
</body> | |
</html> |
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
AdminUser: | |
fields: | |
default: first_name, last_name, role, email, locale | |
list: email, role, status | |
form: first_name, last_name, role, email, password, password_confirmation, locale | |
options: | |
selectors: role, locale | |
booleans: | |
status: Active, Inactive | |
filters: status, role | |
search: first_name, last_name, email | |
application: Admin | |
description: Users Administration |
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
Factory.define :admin_user do |u| | |
u.first_name 'Admin' | |
u.last_name 'User' | |
u.email '[email protected]' | |
u.role 'admin' | |
u.password 'password!' | |
u.token '1A2B3C4D5E6F' | |
u.status true | |
u.locale 'en' | |
end |
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 'test_helper' | |
class Admin::CreditsControllerTest < ActionController::TestCase | |
setup do | |
@admin_user = Factory(:admin_user) | |
@request.session[:admin_user_id] = @admin_user.id | |
@request.env['HTTP_REFERER'] = '/admin/credits/new' | |
end | |
context "new" do | |
should "render new template" do | |
get :new | |
assert_response :success | |
end | |
end | |
end |
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
Typus.setup do |config| | |
# Application name. | |
config.admin_title = "Something" | |
# config.admin_sub_title = "" | |
# When mailer_sender is set, password recover is enabled. This email | |
# address will be used in Admin::Mailer. | |
config.mailer_sender = "[email protected]" | |
# Define paperclip attachment styles. | |
# config.file_preview = :medium | |
# config.file_thumbnail = :thumb | |
# Authentication: +:none+, +:http_basic+ | |
# Run `rails g typus:migration` if you need an advanced authentication system. | |
config.authentication = :session | |
# Define user_class_name. | |
config.user_class_name = "AdminUser" | |
# Define user_fk. | |
config.user_fk = "admin_user_id" | |
# Define master_role. | |
config.master_role = "admin" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment