Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

Commit

Permalink
forgot to add these files
Browse files Browse the repository at this point in the history
  • Loading branch information
gouravtiwari committed Jun 27, 2013
1 parent 03739e3 commit 5794c25
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
log/*.log
pkg/
spec/dummy/db/*.sqlite3
spec/dummy/log/*.log
spec/dummy/log/*
spec/dummy/tmp/
spec/dummy/.sass-cache
tmp/
log/
.DS_Store
*.gem
coverage/
coverage/
6 changes: 0 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ GEM
thor
diff-lcs (1.1.3)
erubis (2.7.0)
factory_girl (4.2.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.2.1)
factory_girl (~> 4.2.0)
railties (>= 3.0.0)
ffi (1.9.0)
formatador (0.2.4)
guard (1.8.1)
Expand Down Expand Up @@ -174,7 +169,6 @@ PLATFORMS
DEPENDENCIES
audit_rails!
coveralls
factory_girl_rails
guard-bundler
guard-rspec
guard-spork
Expand Down
1 change: 0 additions & 1 deletion audit_rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ Gem::Specification.new do |s|

s.add_development_dependency "sqlite3"
s.add_development_dependency "rspec-rails", "~>2.12.0"
s.add_development_dependency 'factory_girl_rails'
end
26 changes: 21 additions & 5 deletions spec/controllers/audit_rails/audits_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'spec_helper'

describe AuditRails::AuditsController do
# Need to push this to spec/routing directory
context 'routes' do
it { expect(:get => "/audits").to route_to(
:controller => "audit_rails/audits",
Expand All @@ -14,13 +15,28 @@
end

context "GET index" do
it "lists audits" do
audit = stub_model(AuditRails::Audit)
AuditRails::Audit.stub(:all) { [audit] }

it "lists audits on page" do
audits = (1..3).map {|t| AuditRails::Audit.create(user_name: 'Fake User',
description: "User logged on at #{t.days.ago}",
action: 'login',
controller: 'sessions')}

get 'index'

expect(assigns(:audits)).to eq([audit])
expect(assigns(:audits)).to eq(audits)
end


it "lists audits in excel" do
audits = (1..3).map {|t| AuditRails::Audit.create(user_name: 'Fake User',
description: "User logged on at #{t.days.ago}",
action: 'login',
controller: 'sessions')}

get 'index', format: 'xls'

response.should be_success
expect(assigns(:audits)).to eq(audits)
end
end

Expand Down
4 changes: 3 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require 'simplecov'
require 'coveralls'

Expand All @@ -12,6 +11,9 @@
add_filter 'lib'
add_filter 'config'
end

ENV["RAILS_ENV"] ||= 'test'

require File.expand_path("../../spec/dummy/config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
Expand Down

0 comments on commit 5794c25

Please sign in to comment.