Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Controller specs items_spec_helper

  • Loading branch information...
commit 85d862c5c88badb4195e31183a78101ccf72a92e 1 parent e58992d
Anup Nivargi anupnivargi authored
4 app/controllers/admin/audios_controller.rb
View
@@ -19,7 +19,7 @@ class Admin::AudiosController < Admin::ApplicationController
#
# This function is linked to an url and called by an AJAX request.
def get_audio_progress
- @current_object=Audio.find(params[:id])
+ @current_object = Audio.find(params[:id])
if params[:check] && params[:check] == 'true'
render :text => @current_object.state
elsif params[:status]
@@ -37,4 +37,4 @@ def download
@audio = Audio.find(params[:id])
send_file(RAILS_ROOT+"/public"+@audio.audio.url.split("?")[0], :disposition => 'inline', :stream => false)
end
-end
+end
30 spec/controllers/audios_controller_spec.rb
View
@@ -0,0 +1,30 @@
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+#require File.expand_path(File.dirname(__FILE__) + '/../controllers/items_controller_spec_helper')
+describe Admin::AudiosController do
+ #include ItemsControllerSpecHelper
+ controller_name 'admin/audios'
+ def object
+ Audio
+ end
+
+ def valid_params
+ {
+ "associated_workspaces"=>["1"],
+ "title"=>"hello",
+ "description"=>"world",
+ "audio" => url_to_attachment_file('audio.mp3'),
+ "keywords_field"=>[]
+ }
+ end
+
+ def invalid_params
+ {
+ "associated_workspaces"=>["1"],
+ "audio" => url_to_attachment_file('empty_file.txt'),
+ "description"=>"world",
+ "title"=>"hello",
+ "keywords_field"=>[]
+ }
+ end
+
+end
2  spec/controllers/images_controller_spec.rb
View
@@ -1,7 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../controllers/items_controller_spec_helper')
-#require "#{RAILS_ROOT}/vendor/engines/acts_as_container/lib/url_helpers"
-#require "#{RAILS_ROOT}/vendor/engines/acts_as_item/lib/url_helpers"
describe Admin::ImagesController do
controller_name 'admin/images'
include ItemsControllerSpecHelper
31 spec/controllers/videos_controller_spec.rb
View
@@ -0,0 +1,31 @@
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+#require File.expand_path(File.dirname(__FILE__) + '/../controllers/items_controller_spec_helper')
+describe Admin::VideosController do
+ controller_name 'admin/videos'
+ #include ItemsControllerSpecHelper
+
+ def object
+ Video
+ end
+
+ def valid_params
+ {
+ "associated_workspaces"=>["1"],
+ "title"=>"hello",
+ "description"=>"world",
+ "video" => url_to_attachment_file('video.flv'),
+ "keywords_field"=>[]
+ }
+ end
+
+ def invalid_params
+ {
+ "associated_workspaces"=>["1"],
+ "video" => url_to_attachment_file('empty_file.txt'),
+ "description"=>"world",
+ "title"=>"hello",
+ "keywords_field"=>[]
+ }
+ end
+
+end
2  spec/models/folder_spec.rb
View
@@ -4,7 +4,7 @@
describe Folder do
fixtures :folders, :items_folders
- #include AuthorizableSpecHelper
+ include AuthorizableSpecHelper
include ContainersSpecHelper
def container
4 spec/models/user_spec.rb
View
@@ -45,8 +45,8 @@
require File.expand_path(File.dirname(__FILE__) + '/authorizable_spec_helper')
describe User do
- #include AuthorizedSpecHelper
- #include AuthorizableSpecHelper
+ include AuthorizedSpecHelper
+ include AuthorizableSpecHelper
fixtures :roles, :permissions,:permissions_roles, :users, :workspaces, :users_containers, :items_workspaces
def object
2  spec/models/website_spec.rb
View
@@ -4,7 +4,7 @@
describe Website do
fixtures :websites, :items_websites
- #include AuthorizableSpecHelper
+ include AuthorizableSpecHelper
include ContainersSpecHelper
def container
2  spec/models/workspace_spec.rb
View
@@ -24,7 +24,7 @@
describe Workspace do
fixtures :workspaces, :items_workspaces
- #include AuthorizableSpecHelper
+ include AuthorizableSpecHelper
include ContainersSpecHelper
def container
Please sign in to comment.
Something went wrong with that request. Please try again.