Skip to content
This repository
Browse code

Controller specs items_spec_helper

  • Loading branch information...
commit 85d862c5c88badb4195e31183a78101ccf72a92e 1 parent e58992d
Anup Nivargi anupnivargi authored
4 app/controllers/admin/audios_controller.rb
@@ -19,7 +19,7 @@ class Admin::AudiosController < Admin::ApplicationController
19 19 #
20 20 # This function is linked to an url and called by an AJAX request.
21 21 def get_audio_progress
22   - @current_object=Audio.find(params[:id])
  22 + @current_object = Audio.find(params[:id])
23 23 if params[:check] && params[:check] == 'true'
24 24 render :text => @current_object.state
25 25 elsif params[:status]
@@ -37,4 +37,4 @@ def download
37 37 @audio = Audio.find(params[:id])
38 38 send_file(RAILS_ROOT+"/public"+@audio.audio.url.split("?")[0], :disposition => 'inline', :stream => false)
39 39 end
40   -end
  40 +end
30 spec/controllers/audios_controller_spec.rb
... ... @@ -0,0 +1,30 @@
  1 +require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
  2 +#require File.expand_path(File.dirname(__FILE__) + '/../controllers/items_controller_spec_helper')
  3 +describe Admin::AudiosController do
  4 + #include ItemsControllerSpecHelper
  5 + controller_name 'admin/audios'
  6 + def object
  7 + Audio
  8 + end
  9 +
  10 + def valid_params
  11 + {
  12 + "associated_workspaces"=>["1"],
  13 + "title"=>"hello",
  14 + "description"=>"world",
  15 + "audio" => url_to_attachment_file('audio.mp3'),
  16 + "keywords_field"=>[]
  17 + }
  18 + end
  19 +
  20 + def invalid_params
  21 + {
  22 + "associated_workspaces"=>["1"],
  23 + "audio" => url_to_attachment_file('empty_file.txt'),
  24 + "description"=>"world",
  25 + "title"=>"hello",
  26 + "keywords_field"=>[]
  27 + }
  28 + end
  29 +
  30 +end
2  spec/controllers/images_controller_spec.rb
... ... @@ -1,7 +1,5 @@
1 1 require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2 2 require File.expand_path(File.dirname(__FILE__) + '/../controllers/items_controller_spec_helper')
3   -#require "#{RAILS_ROOT}/vendor/engines/acts_as_container/lib/url_helpers"
4   -#require "#{RAILS_ROOT}/vendor/engines/acts_as_item/lib/url_helpers"
5 3 describe Admin::ImagesController do
6 4 controller_name 'admin/images'
7 5 include ItemsControllerSpecHelper
31 spec/controllers/videos_controller_spec.rb
... ... @@ -0,0 +1,31 @@
  1 +require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
  2 +#require File.expand_path(File.dirname(__FILE__) + '/../controllers/items_controller_spec_helper')
  3 +describe Admin::VideosController do
  4 + controller_name 'admin/videos'
  5 + #include ItemsControllerSpecHelper
  6 +
  7 + def object
  8 + Video
  9 + end
  10 +
  11 + def valid_params
  12 + {
  13 + "associated_workspaces"=>["1"],
  14 + "title"=>"hello",
  15 + "description"=>"world",
  16 + "video" => url_to_attachment_file('video.flv'),
  17 + "keywords_field"=>[]
  18 + }
  19 + end
  20 +
  21 + def invalid_params
  22 + {
  23 + "associated_workspaces"=>["1"],
  24 + "video" => url_to_attachment_file('empty_file.txt'),
  25 + "description"=>"world",
  26 + "title"=>"hello",
  27 + "keywords_field"=>[]
  28 + }
  29 + end
  30 +
  31 +end
2  spec/models/folder_spec.rb
@@ -4,7 +4,7 @@
4 4
5 5 describe Folder do
6 6 fixtures :folders, :items_folders
7   - #include AuthorizableSpecHelper
  7 + include AuthorizableSpecHelper
8 8 include ContainersSpecHelper
9 9
10 10 def container
4 spec/models/user_spec.rb
@@ -45,8 +45,8 @@
45 45 require File.expand_path(File.dirname(__FILE__) + '/authorizable_spec_helper')
46 46
47 47 describe User do
48   - #include AuthorizedSpecHelper
49   - #include AuthorizableSpecHelper
  48 + include AuthorizedSpecHelper
  49 + include AuthorizableSpecHelper
50 50 fixtures :roles, :permissions,:permissions_roles, :users, :workspaces, :users_containers, :items_workspaces
51 51
52 52 def object
2  spec/models/website_spec.rb
@@ -4,7 +4,7 @@
4 4
5 5 describe Website do
6 6 fixtures :websites, :items_websites
7   - #include AuthorizableSpecHelper
  7 + include AuthorizableSpecHelper
8 8 include ContainersSpecHelper
9 9
10 10 def container
2  spec/models/workspace_spec.rb
@@ -24,7 +24,7 @@
24 24
25 25 describe Workspace do
26 26 fixtures :workspaces, :items_workspaces
27   - #include AuthorizableSpecHelper
  27 + include AuthorizableSpecHelper
28 28 include ContainersSpecHelper
29 29
30 30 def container

0 comments on commit 85d862c

Please sign in to comment.
Something went wrong with that request. Please try again.