Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding the first routing specs.

  • Loading branch information...
commit b2fec6e25166a1d041061d921459339d94e39cee 1 parent 285004e
@daronco authored
View
2  Gemfile
@@ -33,8 +33,10 @@ gem 'therubyracer', :require => 'v8'
group :development, :test do
gem 'rspec-rails', '~> 2.6'
gem 'rspec-instafail'
+ gem 'fuubar'
gem 'shoulda-matchers'
gem 'cucumber-rails', '~> 0.5.0'
gem 'database_cleaner'
gem 'factory_girl'
+ gem 'forgery'
end
View
9 Gemfile.lock
@@ -97,7 +97,13 @@ GEM
multi_json (~> 1.0)
factory_girl (2.0.1)
ffi (1.0.9)
+ forgery (0.3.12)
+ nokogiri (~> 1.4)
fssm (0.2.7)
+ fuubar (0.0.5)
+ rspec (~> 2.0)
+ rspec-instafail (~> 0.1.4)
+ ruby-progressbar (~> 0.0.10)
gherkin (2.4.5)
json (>= 1.4.6)
hike (1.1.0)
@@ -157,6 +163,7 @@ GEM
activesupport (~> 3.0)
railties (~> 3.0)
rspec (~> 2.6.0)
+ ruby-progressbar (0.0.10)
rubyzip (0.9.4)
sass (3.1.2)
selenium-webdriver (0.2.2)
@@ -202,6 +209,8 @@ DEPENDENCIES
database_cleaner
devise
factory_girl
+ forgery
+ fuubar
jquery-rails
json
rails (~> 3.1.0.rc1)
View
2  Rakefile
@@ -12,7 +12,7 @@ require 'rake'
desc 'Default: run specs and features.'
task :default => [:spec, :cucumber]
-RSpec::Core::RakeTask.new(:spec => ["db:test:prepare"])
+#RSpec::Core::RakeTask.new(:spec => ["db:test:prepare"])
#RSpec::Core::RakeTask.new(:spec => ["db:test:prepare", "db:seed"]) # to run dependencies first
BigbluebuttonRailsPlayground::Application.load_tasks
View
105 spec/routing/custom_rooms_routing_spec.rb
@@ -0,0 +1,105 @@
+require 'spec_helper'
+
+describe CustomRoomsController do
+ include Shoulda::Matchers::ActionController
+
+ describe "routing" do
+
+ # standard routes generated by bigbluebutton_rails
+ it {
+ should route(:get, "/bigbluebutton/servers/server-1/rooms").
+ to(:action => :index, :server_id => "server-1")
+ }
+ it {
+ should route(:get, "/bigbluebutton/servers/server-1/rooms/new").
+ to(:action => :new, :server_id => "server-1")
+ }
+ it {
+ should route(:get, "/bigbluebutton/servers/server-1/rooms/external").
+ to(:action => :external, :server_id => "server-1")
+ }
+ it {
+ should route(:post, "/bigbluebutton/servers/server-1/rooms/external").
+ to(:action => :external_auth, :server_id => "server-1")
+ }
+ it {
+ should route(:get, "/bigbluebutton/servers/server-1/rooms/room-1/edit").
+ to(:action => :edit, :server_id => "server-1", :id => "room-1")
+ }
+ it {
+ should route(:get, "/bigbluebutton/servers/server-1/rooms/room-1").
+ to(:action => :show, :server_id => "server-1", :id => "room-1")
+ }
+ it {
+ should route(:put, "/bigbluebutton/servers/server-1/rooms/room-1").
+ to(:action => :update, :server_id => "server-1", :id => "room-1")
+ }
+ it {
+ should route(:delete, "/bigbluebutton/servers/server-1/rooms/room-1").
+ to(:action => :destroy, :server_id => "server-1", :id => "room-1")
+ }
+ it {
+ should route(:get, "/bigbluebutton/servers/server-1/rooms/room-1/join").
+ to(:action => :join, :server_id => "server-1", :id => "room-1")
+ }
+ it {
+ should route(:get, "/bigbluebutton/servers/server-1/rooms/room-1/join_mobile").
+ to(:action => :join_mobile, :server_id => "server-1", :id => "room-1")
+ }
+ it {
+ should route(:get, "/bigbluebutton/servers/server-1/rooms/room-1/running").
+ to(:action => :running, :server_id => "server-1", :id => "room-1")
+ }
+ it {
+ should route(:get, "/bigbluebutton/servers/server-1/rooms/room-1/end").
+ to(:action => :end, :server_id => "server-1", :id => "room-1")
+ }
+ it {
+ should route(:get, "/bigbluebutton/servers/server-1/rooms/room-1/invite").
+ to(:action => :invite, :server_id => "server-1", :id => "room-1")
+ }
+ it {
+ should route(:post, "/bigbluebutton/servers/server-1/rooms/room-1/join").
+ to(:action => :auth, :server_id => "server-1", :id => "room-1")
+ }
+
+ # bigbluebutton_rails room matchers inside 'user'
+ it {
+ should route(:get, "/users/1/room/room-1").
+ to(:action => :show, :user_id => "1", :id => "room-1")
+ }
+ it {
+ should route(:get, "/users/1/room/room-1/join").
+ to(:action => :join, :user_id => "1", :id => "room-1")
+ }
+ it {
+ should route(:get, "/users/1/room/room-1/join_mobile").
+ to(:action => :join_mobile, :user_id => "1", :id => "room-1")
+ }
+ it {
+ should route(:get, "/users/1/room/room-1/running").
+ to(:action => :running, :user_id => "1", :id => "room-1")
+ }
+ it {
+ should route(:get, "/users/1/room/room-1/end").
+ to(:action => :end, :user_id => "1", :id => "room-1")
+ }
+ it {
+ should route(:get, "/users/1/room/room-1/invite").
+ to(:action => :invite, :user_id => "1", :id => "room-1")
+ }
+ it {
+ should route(:post, "/users/1/room/room-1/join").
+ to(:action => :auth, :user_id => "1", :id => "room-1")
+ }
+
+ # our custom routes added to /users/
+ it {
+ should route(:get, "/users/1/new_room").
+ to(:action => :user_new, :user_id => "1")
+ }
+
+ end
+
+end
+
View
18 spec/routing/custom_servers_routing_spec.rb
@@ -0,0 +1,18 @@
+require 'spec_helper'
+
+describe CustomServersController do
+ include Shoulda::Matchers::ActionController
+
+ # standard routes generated by bigbluebutton_rails
+ describe "routing" do
+ it { should route(:get, "/bigbluebutton/servers").to(:action => :index) }
+ it { should route(:post, "/bigbluebutton/servers").to(:action => :create) }
+ it { should route(:get, "/bigbluebutton/servers/new").to(:action => :new) }
+ it { should route(:get, "/bigbluebutton/servers/server-1/edit").to(:action => :edit, :id => "server-1") }
+ it { should route(:get, "/bigbluebutton/servers/server-1").to(:action => :show, :id => "server-1") }
+ it { should route(:put, "/bigbluebutton/servers/server-1").to(:action => :update, :id => "server-1") }
+ it { should route(:delete, "/bigbluebutton/servers/server-1").to(:action => :destroy, :id => "server-1") }
+ end
+
+end
+
View
12 spec/routing/home_routing_spec.rb
@@ -0,0 +1,12 @@
+require 'spec_helper'
+
+describe HomeController do
+ include Shoulda::Matchers::ActionController
+
+ describe "routing" do
+ pending { should route(:get, "/").to(:action => :index) }
+ it { should route(:get, "/home/index").to(:action => :index) }
+ end
+
+end
+
View
3  spec/spec_helper.rb
@@ -2,6 +2,7 @@
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
+require "shoulda-matchers"
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
@@ -22,7 +23,7 @@
config.mock_with :rspec
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
- config.fixture_path = "#{::Rails.root}/spec/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
View
2  spec/support/shoulda/accept_nested_attributes_for.rb
@@ -1,6 +1,6 @@
module Shoulda
module Matchers
- module ActiveRecord # :nodoc
+ module ActiveModel # :nodoc
# Usage example: accept_nested_attributes_for(:address)
def accept_nested_attributes_for(attribute)
View
2  spec/support/shoulda/have_attr_accessor.rb
@@ -5,7 +5,7 @@
# it { should have_attr_accessor(:value).write_only }
module Shoulda
module Matchers
- module ActiveRecord # :nodoc
+ module ActiveModel # :nodoc
def have_attr_accessor(attribute)
HaveAttrAccessorMatcher.new(attribute)
Please sign in to comment.
Something went wrong with that request. Please try again.