Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initialized rspec and removed test-unit files

  • Loading branch information...
commit addcaaf62b61303d3e107412cf22eb40a1fdaaa8 1 parent 3d0758d
@gorrillamcd authored
Showing with 56 additions and 219 deletions.
  1. +1 −0  .rspec
  2. +7 −3 Gemfile
  3. +3 −0  Gemfile.lock
  4. +1 −19 Guardfile
  5. +5 −0 spec/factories.rb
  6. +7 −0 spec/requests/courses_spec.rb
  7. +32 −0 spec/spec_helper.rb
  8. 0  test/fixtures/.gitkeep
  9. +0 −11 test/fixtures/answers.yml
  10. +0 −13 test/fixtures/books.yml
  11. +0 −11 test/fixtures/courses.yml
  12. +0 −9 test/fixtures/exams.yml
  13. +0 −13 test/fixtures/lessons.yml
  14. +0 −11 test/fixtures/questions.yml
  15. +0 −11 test/fixtures/users.yml
  16. 0  test/functional/.gitkeep
  17. +0 −7 test/functional/courses_controller_test.rb
  18. +0 −7 test/functional/exams_controller_test.rb
  19. +0 −7 test/functional/lessons_controller_test.rb
  20. +0 −7 test/functional/questions_controller_test.rb
  21. 0  test/integration/.gitkeep
  22. +0 −12 test/performance/browsing_test.rb
  23. +0 −13 test/test_helper.rb
  24. 0  test/unit/.gitkeep
  25. +0 −7 test/unit/answer_test.rb
  26. +0 −7 test/unit/books_test.rb
  27. +0 −7 test/unit/course_test.rb
  28. +0 −7 test/unit/exam_test.rb
  29. +0 −4 test/unit/helpers/courses_helper_test.rb
  30. +0 −4 test/unit/helpers/exams_helper_test.rb
  31. +0 −4 test/unit/helpers/lessons_helper_test.rb
  32. +0 −4 test/unit/helpers/questions_helper_test.rb
  33. +0 −7 test/unit/lesson_test.rb
  34. +0 −7 test/unit/question_test.rb
  35. +0 −7 test/unit/user_test.rb
View
1  .rspec
@@ -0,0 +1 @@
+--colour
View
10 Gemfile
@@ -13,17 +13,21 @@ gem 'devise'
gem 'cancan'
gem 'bcrypt-ruby', '~> 3.0.0'
+group :development do
+ gem 'libnotify' # for linux notifications
+ # gem 'growl' # For Mac growl notifications
+end
+
+gem 'cucumber-rails', :group => :test
group :development, :test do
gem 'capybara'
+ gem 'launchy'
gem 'factory_girl_rails'
gem 'rspec-rails'
- gem 'cucumber-rails'
# Gem related to guard
gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i#only include gem if on OS10(Mac)
- gem 'libnotify' # for linux notifications
- # gem 'growl' # For Mac growl notifications
gem 'guard-rspec'
gem 'guard-cucumber'
end
View
3  Gemfile.lock
@@ -95,6 +95,8 @@ GEM
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
json (1.6.6)
+ launchy (2.1.0)
+ addressable (~> 2.2.6)
libnotify (0.7.2)
libv8 (3.3.10.4)
libwebsocket (0.1.3)
@@ -209,6 +211,7 @@ DEPENDENCIES
guard-rspec
jquery-rails
json
+ launchy
libnotify
mysql2
paperclip
View
20 Guardfile
@@ -15,22 +15,4 @@ guard 'rspec', :version => 2 do
watch('app/controllers/application_controller.rb') { "spec/controllers" }
# Capybara request specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
-end
-
-
-guard 'rspec', :version => 2 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 request specs
- watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
-end
-
+end
View
5 spec/factories.rb
@@ -0,0 +1,5 @@
+Factory.define :student do |f|
+ f.sequence(:email) { |n| "foo#{n}@example.com"}
+ f.password "secret"
+ f.role "student"
+end
View
7 spec/requests/courses_spec.rb
@@ -0,0 +1,7 @@
+require 'spec_helper'
+
+describe "Courses" do
+ it "creates a new course" do
+ user = Factory(:student)
+ end
+end
View
32 spec/spec_helper.rb
@@ -0,0 +1,32 @@
+# 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 'rspec/rails'
+require 'rspec/autorun'
+
+# Requires supporting ruby files with custom matchers and macros, etc,
+# in spec/support/ and its subdirectories.
+Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
+
+RSpec.configure do |config|
+ # ## Mock Framework
+ #
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
+ #
+ # config.mock_with :mocha
+ # config.mock_with :flexmock
+ # config.mock_with :rr
+
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
+
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
+ # examples within a transaction, remove the following line or assign false
+ # instead of true.
+ config.use_transactional_fixtures = true
+
+ # If true, the base class of anonymous controllers will be inferred
+ # automatically. This will be the default behavior in future versions of
+ # rspec-rails.
+ config.infer_base_class_for_anonymous_controllers = false
+end
View
0  test/fixtures/.gitkeep
No changes.
View
11 test/fixtures/answers.yml
@@ -1,11 +0,0 @@
-# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
-
-one:
- text: MyString
- correct: false
- question:
-
-two:
- text: MyString
- correct: false
- question:
View
13 test/fixtures/books.yml
@@ -1,13 +0,0 @@
-# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
-
-one:
- isbn: MyString
- name: MyString
- required: false
- references:
-
-two:
- isbn: MyString
- name: MyString
- required: false
- references:
View
11 test/fixtures/courses.yml
@@ -1,11 +0,0 @@
-# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
-
-one:
- name: MyString
- description: MyString
- lesson:
-
-two:
- name: MyString
- description: MyString
- lesson:
View
9 test/fixtures/exams.yml
@@ -1,9 +0,0 @@
-# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
-
-one:
- name: MyString
- lesson:
-
-two:
- name: MyString
- lesson:
View
13 test/fixtures/lessons.yml
@@ -1,13 +0,0 @@
-# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
-
-one:
- name: MyString
- description: MyString
- teaching: MyString
- class:
-
-two:
- name: MyString
- description: MyString
- teaching: MyString
- class:
View
11 test/fixtures/questions.yml
@@ -1,11 +0,0 @@
-# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
-
-one:
- text: MyString
- lesson:
- exam:
-
-two:
- text: MyString
- lesson:
- exam:
View
11 test/fixtures/users.yml
@@ -1,11 +0,0 @@
-# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
-
-# This model initially had no columns defined. If you add columns to the
-# model remove the '{}' from the fixture names and add the columns immediately
-# below each fixture, per the syntax in the comments below
-#
-one: {}
-# column: value
-#
-two: {}
-# column: value
View
0  test/functional/.gitkeep
No changes.
View
7 test/functional/courses_controller_test.rb
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class CoursesControllerTest < ActionController::TestCase
- # test "the truth" do
- # assert true
- # end
-end
View
7 test/functional/exams_controller_test.rb
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class ExamsControllerTest < ActionController::TestCase
- # test "the truth" do
- # assert true
- # end
-end
View
7 test/functional/lessons_controller_test.rb
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class LessonsControllerTest < ActionController::TestCase
- # test "the truth" do
- # assert true
- # end
-end
View
7 test/functional/questions_controller_test.rb
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class QuestionsControllerTest < ActionController::TestCase
- # test "the truth" do
- # assert true
- # end
-end
View
0  test/integration/.gitkeep
No changes.
View
12 test/performance/browsing_test.rb
@@ -1,12 +0,0 @@
-require 'test_helper'
-require 'rails/performance_test_help'
-
-class BrowsingTest < ActionDispatch::PerformanceTest
- # Refer to the documentation for all available options
- # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
- # :output => 'tmp/performance', :formats => [:flat] }
-
- def test_homepage
- get '/'
- end
-end
View
13 test/test_helper.rb
@@ -1,13 +0,0 @@
-ENV["RAILS_ENV"] = "test"
-require File.expand_path('../../config/environment', __FILE__)
-require 'rails/test_help'
-
-class ActiveSupport::TestCase
- # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
- #
- # Note: You'll currently still have to declare fixtures explicitly in integration tests
- # -- they do not yet inherit this setting
- fixtures :all
-
- # Add more helper methods to be used by all tests here...
-end
View
0  test/unit/.gitkeep
No changes.
View
7 test/unit/answer_test.rb
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class AnswerTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
-end
View
7 test/unit/books_test.rb
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class BooksTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
-end
View
7 test/unit/course_test.rb
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class CourseTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
-end
View
7 test/unit/exam_test.rb
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class ExamTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
-end
View
4 test/unit/helpers/courses_helper_test.rb
@@ -1,4 +0,0 @@
-require 'test_helper'
-
-class CoursesHelperTest < ActionView::TestCase
-end
View
4 test/unit/helpers/exams_helper_test.rb
@@ -1,4 +0,0 @@
-require 'test_helper'
-
-class ExamsHelperTest < ActionView::TestCase
-end
View
4 test/unit/helpers/lessons_helper_test.rb
@@ -1,4 +0,0 @@
-require 'test_helper'
-
-class LessonsHelperTest < ActionView::TestCase
-end
View
4 test/unit/helpers/questions_helper_test.rb
@@ -1,4 +0,0 @@
-require 'test_helper'
-
-class QuestionsHelperTest < ActionView::TestCase
-end
View
7 test/unit/lesson_test.rb
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class LessonTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
-end
View
7 test/unit/question_test.rb
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class QuestionTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
-end
View
7 test/unit/user_test.rb
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class UserTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
-end
Please sign in to comment.
Something went wrong with that request. Please try again.