Skip to content

Commit

Permalink
Merge pull request #40 from mccabe615/master
Browse files Browse the repository at this point in the history
Minor Changes
  • Loading branch information
cktricky committed Sep 10, 2013
2 parents 65eb2ca + 9638d81 commit 2eeb829
Show file tree
Hide file tree
Showing 12 changed files with 117 additions and 15 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: ruby
rvm:
- "1.9.3"
before_script: rake db:migrate
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ gem 'foreman'
group :development do
gem 'brakeman'
gem 'guard-brakeman'
gem 'guard-rspec'
gem 'rb-fsevent'
gem 'guard-shell'
gem 'bundler-audit'
gem 'guard-livereload'
gem 'rack-livereload'
gem 'travis-lint'
end

gem 'gauntlt'
Expand All @@ -25,7 +27,6 @@ group :development, :test do
gem 'rspec-rails'
end


# Gems used only for assets and not required
# in production environments by default.
group :assets do
Expand Down Expand Up @@ -56,6 +57,8 @@ gem 'powder'
gem 'aruba'
gem 'minitest', '~> 4.0', :require=> "minitest/autorun"

#gem 'minitest'

# Deploy with Capistrano
# gem 'capistrano'

Expand Down
16 changes: 14 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,14 @@ GEM
em-websocket (>= 0.2.0)
guard (>= 1.5.0)
multi_json (~> 1.0)
guard-rspec (2.5.4)
guard (>= 1.1)
rspec (~> 2.11)
guard-shell (0.5.1)
guard (>= 1.1.0)
haml (4.0.2)
tilt
hashr (0.0.22)
highline (1.6.16)
hike (1.2.2)
http_parser.rb (0.5.3)
Expand Down Expand Up @@ -159,10 +163,14 @@ GEM
rb-fsevent (0.9.3)
rdoc (3.12.2)
json (~> 1.4)
rspec-core (2.14.4)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.2)
rspec-expectations (2.14.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.2)
rspec-mocks (2.14.1)
rspec-rails (2.14.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
Expand Down Expand Up @@ -195,6 +203,8 @@ GEM
terminal-table (1.4.5)
thor (0.18.1)
tilt (1.3.7)
travis-lint (1.7.0)
hashr (~> 0.0.22)
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
Expand All @@ -221,6 +231,7 @@ DEPENDENCIES
gauntlt
guard-brakeman
guard-livereload
guard-rspec
guard-shell
jquery-fileupload-rails
jquery-rails
Expand All @@ -232,5 +243,6 @@ DEPENDENCIES
rspec-rails
sass-rails (~> 3.2.3)
sqlite3
travis-lint
uglifier (>= 1.0.3)
unicorn
23 changes: 23 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,26 @@ guard 'livereload', host: "railsgoat.dev", port: '35727' do
# Rails Assets Pipeline
watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html))).*}) { |m| "/assets/#{m[3]}" }
end


guard 'rspec' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }

# Rails example
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch('config/routes.rb') { "spec/routing" }
watch('app/controllers/application_controller.rb') { "spec/controllers" }

# Capybara features specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/features/#{m[1]}_spec.rb" }

# Turnip features and steps
watch(%r{^spec/acceptance/(.+)\.feature$})
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
end

27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## Getting Started ##
#### With Ruby, Rubygems, Git, and Bundler installed ####

git clone https://github.com/OWASP/railsgoat.git

cd railsgoat

rvm use 1.9.3@railsgoat --create

bundle

rake db:create

rake db:migrate

rails s

open http://0.0.0.0:3000

Start hacking!!!

### Developer Note ###
<p/>
Conversion to the OWASP Top 10, 2013 is under way.
Expand All @@ -9,6 +30,10 @@ You can view progress within the top-10-2013 branch.
Then proceed with browsing the site as normal :thumbsup:
<hr/>

### Build Info ###

[![Code Climate](https://codeclimate.com/github/OWASP/railsgoat.png)](https://codeclimate.com/github/OWASP/railsgoat)

### License Stuff ###

The MIT License (MIT)
Expand All @@ -33,4 +58,4 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

<hr/>
<hr/>
2 changes: 2 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class User < ActiveRecord::Base
has_many :performance, :foreign_key => :user_id, :primary_key => :user_id, :dependent => :destroy


private

def full_name
"#{self.first_name} #{self.last_name}"
end
Expand Down
1 change: 1 addition & 0 deletions spec/models/benefits_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require 'spec_helper'
14 changes: 14 additions & 0 deletions spec/models/paid_time_off_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'spec_helper.rb'
=begin
describe "PaidTimeOff" do
user = User.new(
first_name: 'Tester',
last_name: 'MGee',
email: '[email protected]',
password: 'password',
password_confirmation: 'password'
)
expect(user).to be_valid
end
=end
28 changes: 28 additions & 0 deletions spec/models/user_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require 'spec_helper.rb'

describe User do
it "can be instantiated" do
User.new.should be_an_instance_of(User)
end

it "should require a email" do
User.new(:email => "").should_not be_valid
end

it "should require valid email" do
User.new(:email => "[email protected]@gmail.com").should_not be_valid
end

it "should require unique email" do
user = User.all.first
User.new(:email => user.email).should_not be_valid
end

it "name can be updated" do
new_name = "Bobby"
user = User.all.first
user.first_name = new_name
user.save!
User.all.first.first_name.should == new_name
end
end
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'minitest/autorun'
require 'rspec/rails'
require 'rspec/autorun'

Expand Down
6 changes: 1 addition & 5 deletions test/functional/users_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
require 'test_helper'

class UsersControllerTest < ActionController::TestCase
test "should get new" do
get :new
assert_response :success
end

end
end
5 changes: 0 additions & 5 deletions test/unit/benefits_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
require 'test_helper'

class BenefitsTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

0 comments on commit 2eeb829

Please sign in to comment.