Skip to content

Commit

Permalink
Broken Authorization specs added.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismo committed Sep 27, 2013
1 parent 269d5a0 commit 1c8b6e9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions spec/features/broken_auth_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
require 'spec_helper'

feature 'broken_auth' do
before do
UserFixture.reset_all_users
@normal_user = UserFixture.normal_user
end

scenario 'TMI during login', :js => true do
visit '/'
within('.signup') do
fill_in 'email', :with => @normal_user.email + 'not'
fill_in 'password', :with => @normal_user.clear_password
end
click_on 'Login'
find('div#flash_notice').text.should == "#{@normal_user.email}not doesn't exist!"

within('.signup') do
fill_in 'email', :with => @normal_user.email
fill_in 'password', :with => @normal_user.clear_password + 'not'
end
click_on 'Login'
find('div#flash_notice').text.should == 'Incorrect Password!'
end
end
2 changes: 1 addition & 1 deletion spec/features/xss_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@normal_user = UserFixture.normal_user
end

scenario 'injection attack on account_settings', :js => true do
scenario 'xss attack on account_settings', :js => true do
login @normal_user

visit "/users/#{@normal_user.user_id}/account_settings"
Expand Down

0 comments on commit 1c8b6e9

Please sign in to comment.