Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require File.dirname(__FILE__) + '/../test_helper'
- class EditorActionsTest < ActionController::IntegrationTest
- # CNK not sure if we are going to use fixtures
- # I would prefer to use factories but am having trouble with that
- # fixtures :users, :roles, :roles_users, :pages
- def setup
- @home_page = Factory.create_home_page
- @editor = Factory.create_user_with_role('editor', :login => 'abenter', :email => 'abenter@caltech.edu', :password => 'abenter', :password_confirmation => 'abenter')
- end
- def test_editor_editing_pages
- # Before logging in, there shouldn't be any edit links
- get '/'
- assert_response :success
- assert_no_tag "a[href=login]"
- # now login, and we should have edit links
- puts "login is #{@editor.login}"
- puts "login is #{@editor.password}"
- get '/login'
- assert_template 'sessions/new'
- assert_select "form" do
- assert_select "input#password"
- end
- post '/session', :user => {:login => @editor.login, :password => @editor.password}
- # assert_redirected_to '/'
- assert_match /Invalid/, flash[:notice]
- end
- end
Add Comment
Please, Sign In to add comment