OSDN Git Service

Merge branch 'v03_test' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v03_test
authoryasushiito <yasushiito@git.sourceforge.jp>
Sun, 15 Apr 2012 10:57:36 +0000 (19:57 +0900)
committeryasushiito <yasushiito@git.sourceforge.jp>
Sun, 15 Apr 2012 10:57:36 +0000 (19:57 +0900)
167 files changed:
.gitignore
Gemfile
Gemfile.lock
app/controllers/application_controller.rb
app/controllers/artists_controller.rb
app/controllers/authors_controller.rb
app/controllers/comics_controller.rb
app/controllers/panel_pictures_controller.rb
app/controllers/resource_pictures_controller.rb
app/models/artist.rb
app/models/author.rb
app/models/comic.rb
app/models/common_license.rb
app/models/panel_picture.rb
app/models/resource_picture.rb
app/views/layouts/system.html.erb
app/views/system/start.html.erb
autotest/discover.rb [new file with mode: 0644]
config/routes.rb
db/common_licenses.json [new file with mode: 0644]
lib/local_picture.rb
lib/s3_picture.rb
lib/test/local_picture_spec.rb [new file with mode: 0644]
lib/test/s3_picture_spec.rb [new file with mode: 0644]
spec/controllers/admins/sessions_controller_spec.rb
spec/controllers/app_controller_spec.rb [new file with mode: 0644]
spec/controllers/artists_controller_spec.rb
spec/controllers/author_registrations_controller_spec.rb
spec/controllers/authors/sessions_controller_spec.rb [deleted file]
spec/controllers/authors_controller_spec.rb
spec/controllers/balloon_templates_controller_spec.rb [new file with mode: 0644]
spec/controllers/balloons_controller_spec.rb [new file with mode: 0644]
spec/controllers/baloon_templates_controller_spec.rb [deleted file]
spec/controllers/baloon_types_controller_spec.rb [deleted file]
spec/controllers/baloons_controller_spec.rb [deleted file]
spec/controllers/comics_controller_spec.rb
spec/controllers/licenses_controller_spec.rb
spec/controllers/original_licenses_controller_spec.rb
spec/controllers/panel_pictures_controller_spec.rb [new file with mode: 0644]
spec/controllers/panels_controller_spec.rb
spec/controllers/pictures_controller_spec.rb [deleted file]
spec/controllers/resource_pictures_controller_spec.rb [new file with mode: 0644]
spec/controllers/source_pictures_controller_spec.rb [deleted file]
spec/controllers/speach_balloons_controller_spec.rb [new file with mode: 0644]
spec/controllers/speach_baloons_controller_spec.rb [deleted file]
spec/controllers/speach_templates_controller_spec.rb
spec/controllers/speachbaloons_controller_spec.rb [deleted file]
spec/controllers/speaches_controller_spec.rb
spec/controllers/system_pictures_controller_spec.rb
spec/controllers/users/sessions_controller_spec.rb [new file with mode: 0644]
spec/factories.rb
spec/helpers/admins/sessions_helper_spec.rb
spec/helpers/author_registrations_helper_spec.rb [deleted file]
spec/helpers/balloon_templates_helper_spec.rb [moved from spec/helpers/baloon_templates_helper_spec.rb with 91% similarity]
spec/helpers/balloons_helper_spec.rb [moved from spec/helpers/baloons_helper_spec.rb with 93% similarity]
spec/helpers/baloon_types_helper_spec.rb [deleted file]
spec/helpers/panel_pictures_helper_spec.rb [moved from spec/helpers/pictures_helper_spec.rb with 92% similarity]
spec/helpers/resource_pictures_helper_spec.rb [moved from spec/helpers/source_pictures_helper_spec.rb with 91% similarity]
spec/helpers/speach_balloons_helper_spec.rb [moved from spec/helpers/speach_baloons_helper_spec.rb with 92% similarity]
spec/helpers/speachbaloons_helper_spec.rb [deleted file]
spec/helpers/users/sessions_helper_spec.rb [moved from spec/helpers/authors/sessions_helper_spec.rb with 77% similarity]
spec/models/artist_spec.rb
spec/models/author_spec.rb
spec/models/balloon_spec.rb [moved from spec/models/picture_spec.rb with 80% similarity]
spec/models/balloon_template_spec.rb [moved from spec/models/baloon_template_spec.rb with 75% similarity]
spec/models/baloon_type_spec.rb [deleted file]
spec/models/panel_picture_spec.rb
spec/models/speach_balloon_spec.rb [moved from spec/models/baloon_spec.rb with 76% similarity]
spec/models/speach_baloon_spec.rb [deleted file]
spec/models/speachbaloon_spec.rb [deleted file]
spec/models/user_spec.rb
spec/requests/artists_spec.rb [deleted file]
spec/requests/baloon_templates_spec.rb [deleted file]
spec/requests/baloon_types_spec.rb [deleted file]
spec/requests/baloons_spec.rb [deleted file]
spec/requests/common_licenses_spec.rb [deleted file]
spec/requests/licenses_spec.rb [deleted file]
spec/requests/original_licenses_spec.rb [deleted file]
spec/requests/original_pictures_spec.rb [deleted file]
spec/requests/panels_spec.rb [deleted file]
spec/requests/pictures_spec.rb [deleted file]
spec/requests/source_pictures_spec.rb [deleted file]
spec/requests/speach_baloons_spec.rb [deleted file]
spec/requests/speach_templates_spec.rb [deleted file]
spec/requests/speachbaloons_spec.rb [deleted file]
spec/requests/speaches_spec.rb [deleted file]
spec/requests/system_pictures_spec.rb [deleted file]
spec/routing/artists_routing_spec.rb [deleted file]
spec/routing/baloon_templates_routing_spec.rb [deleted file]
spec/routing/baloon_types_routing_spec.rb [deleted file]
spec/routing/baloons_routing_spec.rb [deleted file]
spec/routing/common_licenses_routing_spec.rb [deleted file]
spec/routing/licenses_routing_spec.rb [deleted file]
spec/routing/original_licenses_routing_spec.rb [deleted file]
spec/routing/original_pictures_routing_spec.rb [deleted file]
spec/routing/panels_routing_spec.rb [deleted file]
spec/routing/pictures_routing_spec.rb [deleted file]
spec/routing/source_pictures_routing_spec.rb [deleted file]
spec/routing/speach_baloons_routing_spec.rb [deleted file]
spec/routing/speach_templates_routing_spec.rb [deleted file]
spec/routing/speachbaloons_routing_spec.rb [deleted file]
spec/routing/speaches_routing_spec.rb [deleted file]
spec/routing/system_pictures_routing_spec.rb [deleted file]
spec/views/artists/edit.html.erb_spec.rb [deleted file]
spec/views/artists/index.html.erb_spec.rb [deleted file]
spec/views/artists/new.html.erb_spec.rb [deleted file]
spec/views/artists/show.html.erb_spec.rb [deleted file]
spec/views/baloon_templates/edit.html.erb_spec.rb [deleted file]
spec/views/baloon_templates/index.html.erb_spec.rb [deleted file]
spec/views/baloon_templates/new.html.erb_spec.rb [deleted file]
spec/views/baloon_templates/show.html.erb_spec.rb [deleted file]
spec/views/baloon_types/edit.html.erb_spec.rb [deleted file]
spec/views/baloon_types/index.html.erb_spec.rb [deleted file]
spec/views/baloon_types/new.html.erb_spec.rb [deleted file]
spec/views/baloon_types/show.html.erb_spec.rb [deleted file]
spec/views/baloons/edit.html.erb_spec.rb [deleted file]
spec/views/baloons/index.html.erb_spec.rb [deleted file]
spec/views/baloons/new.html.erb_spec.rb [deleted file]
spec/views/baloons/show.html.erb_spec.rb [deleted file]
spec/views/common_licenses/edit.html.erb_spec.rb [deleted file]
spec/views/common_licenses/index.html.erb_spec.rb [deleted file]
spec/views/common_licenses/new.html.erb_spec.rb [deleted file]
spec/views/common_licenses/show.html.erb_spec.rb [deleted file]
spec/views/licenses/edit.html.erb_spec.rb [deleted file]
spec/views/licenses/index.html.erb_spec.rb [deleted file]
spec/views/licenses/new.html.erb_spec.rb [deleted file]
spec/views/licenses/show.html.erb_spec.rb [deleted file]
spec/views/original_licenses/edit.html.erb_spec.rb [deleted file]
spec/views/original_licenses/index.html.erb_spec.rb [deleted file]
spec/views/original_licenses/new.html.erb_spec.rb [deleted file]
spec/views/original_licenses/show.html.erb_spec.rb [deleted file]
spec/views/original_pictures/edit.html.erb_spec.rb [deleted file]
spec/views/original_pictures/index.html.erb_spec.rb [deleted file]
spec/views/original_pictures/new.html.erb_spec.rb [deleted file]
spec/views/original_pictures/show.html.erb_spec.rb [deleted file]
spec/views/panels/edit.html.erb_spec.rb [deleted file]
spec/views/panels/index.html.erb_spec.rb [deleted file]
spec/views/panels/new.html.erb_spec.rb [deleted file]
spec/views/panels/show.html.erb_spec.rb [deleted file]
spec/views/pictures/edit.html.erb_spec.rb [deleted file]
spec/views/pictures/index.html.erb_spec.rb [deleted file]
spec/views/pictures/new.html.erb_spec.rb [deleted file]
spec/views/pictures/show.html.erb_spec.rb [deleted file]
spec/views/source_pictures/edit.html.erb_spec.rb [deleted file]
spec/views/source_pictures/index.html.erb_spec.rb [deleted file]
spec/views/source_pictures/new.html.erb_spec.rb [deleted file]
spec/views/source_pictures/show.html.erb_spec.rb [deleted file]
spec/views/speach_baloons/edit.html.erb_spec.rb [deleted file]
spec/views/speach_baloons/index.html.erb_spec.rb [deleted file]
spec/views/speach_baloons/new.html.erb_spec.rb [deleted file]
spec/views/speach_baloons/show.html.erb_spec.rb [deleted file]
spec/views/speach_templates/edit.html.erb_spec.rb [deleted file]
spec/views/speach_templates/index.html.erb_spec.rb [deleted file]
spec/views/speach_templates/new.html.erb_spec.rb [deleted file]
spec/views/speach_templates/show.html.erb_spec.rb [deleted file]
spec/views/speachbaloons/edit.html.erb_spec.rb [deleted file]
spec/views/speachbaloons/index.html.erb_spec.rb [deleted file]
spec/views/speachbaloons/new.html.erb_spec.rb [deleted file]
spec/views/speachbaloons/show.html.erb_spec.rb [deleted file]
spec/views/speaches/edit.html.erb_spec.rb [deleted file]
spec/views/speaches/index.html.erb_spec.rb [deleted file]
spec/views/speaches/new.html.erb_spec.rb [deleted file]
spec/views/speaches/show.html.erb_spec.rb [deleted file]
spec/views/system_pictures/edit.html.erb_spec.rb [deleted file]
spec/views/system_pictures/index.html.erb_spec.rb [deleted file]
spec/views/system_pictures/new.html.erb_spec.rb [deleted file]
spec/views/system_pictures/show.html.erb_spec.rb [deleted file]

index 5aff11a..884a5b9 100644 (file)
@@ -5,3 +5,4 @@ tmp/
 .sass-cache/
 public/image/*
 config/aws.yaml
+lib/test/temp/
diff --git a/Gemfile b/Gemfile
index 66deaca..512ff14 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -49,4 +49,5 @@ group :development, :test do
   gem 'database_cleaner'
   gem 'rails-erd'
   gem 'factory_girl'
+  gem 'autotest'
 end
index 3075490..6eb9cb6 100644 (file)
@@ -1,6 +1,7 @@
 GEM
   remote: http://rubygems.org/
   specs:
+    ZenTest (4.7.0)
     actionmailer (3.1.1)
       actionpack (= 3.1.1)
       mail (~> 2.3.0)
@@ -30,6 +31,8 @@ GEM
     activesupport (3.1.1)
       multi_json (~> 1.0)
     arel (2.2.1)
+    autotest (4.4.6)
+      ZenTest (>= 4.4.1)
     aws-s3 (0.6.2)
       builder
       mime-types
@@ -179,6 +182,7 @@ PLATFORMS
   x86-mingw32
 
 DEPENDENCIES
+  autotest
   aws-s3
   coffee-rails (~> 3.1.1)
   cucumber
index 978f3d9..79a5b24 100644 (file)
@@ -3,7 +3,7 @@ class ApplicationController < ActionController::Base
   before_filter :bf
   
   def bf
-    if Admin.count.to_i == 0
+    if Admin.count.to_i == 0 or License.count.to_i == 0
       if params[:controller] == 'system' and params[:action] == 'start'
       else
         redirect_to :controller => '/system', :action => 'start'
index af25a17..ae96dd9 100644 (file)
@@ -6,25 +6,34 @@ layout 'test'
   # GET /artists
   # GET /artists.json
   def index
-    @artists = Artist.all
+    @page = Artist.page params[:page]
+    @page_size = Artist.page_size params[:page_size]
+    @artists = Artist.list({}, @page, @page_size)
 
     respond_to do |format|
       format.html # index.html.erb
-      format.json { render json: @artists }
+      format.json { render :json => @artists.to_json(Artist.list_json_opt) }
     end
   end
 
   # GET /artists/1
   # GET /artists/1.json
   def show
-    @artist = Artist.find(params[:id])
+    @artist = Artist.show(params[:id])
 
     respond_to do |format|
       format.html # show.html.erb
-      format.json { render json: @artist }
+      format.json { render :json => @artist.to_json(Artist.list_json_opt) }
     end
   end
 
+  def count
+    @artist = {:count => Artist.visible_count}
+    respond_to do |format|
+      format.json { render json: @artist.to_json }
+    end
+  end
+  
   def list
     @artists = Artist.all
 
index 6371ffd..fa3003d 100644 (file)
@@ -3,21 +3,32 @@ class AuthorsController < ApplicationController
   before_filter :authenticate_admin!, :only => [:list, :browse]
 
   def index
-    @authors = Author.all
+    @page = Author.page params[:page]
+    @page_size = Author.page_size params[:page_size]
+    @authors = Author.list({}, @page, @page_size)
 
     respond_to do |format|
       format.html # index.html.erb
+      format.json { render :json => @authors.to_json(Author.list_json_opt) }
     end
   end
 
   def show
-    @author = Author.find(params[:id])
+    @author = Author.show(params[:id])
 
     respond_to do |format|
       format.html
+      format.json { render :json => @author.to_json(Author.list_json_opt) }
     end
   end
 
+  def count
+    @author = {:count => Author.visible_count}
+    respond_to do |format|
+      format.json { render json: @author.to_json }
+    end
+  end
+  
   def list
     @authors = Author.all
 
index 4a954e2..1805598 100644 (file)
@@ -61,7 +61,7 @@ class ComicsController < ApplicationController
     c = Comic.show(params[:id], @author)
     cnt = Panel.count(:conditions => ['comic_id = ?', c.id]).to_i
     @offset = Comic.offset cnt, params[:offset]
-    @count = Comic.count cnt, params[:count]
+    @panel_count = Comic.panel_count cnt, params[:count]
     @comic = Comic.play(params[:id])
     respond_to do |format|
       format.html # index.html.erb
index 95ea5ff..94ebf94 100644 (file)
@@ -5,11 +5,13 @@ class PanelPicturesController < ApplicationController
   # GET /panel_pictures
   # GET /panel_pictures.json
   def index
-    @panel_pictures = PanelPicture.all
+    @page = PanelPicture.page params[:page]
+    @page_size = PanelPicture.page_size params[:page_size]
+    @panel_pictures = PanelPicture.list({}, @page, @page_size)
 
     respond_to do |format|
       format.html # index.html.erb
-      format.json { render json: @panel_pictures }
+      format.json { render :json => @panel_pictures.to_json(PanelPicture.list_json_opt) }
     end
   end
 
index 4b17772..a68cd7c 100644 (file)
@@ -5,22 +5,20 @@ class ResourcePicturesController < ApplicationController
   # GET /resource_pictures
   # GET /resource_pictures.json
   def index
-    @resource_pictures = ResourcePicture.find(:all, 
-      :include => {:original_picture => [:artist, :license]}, :order => 'updated_at', :limit => 20
-    )
+    @page = ResourcePicture.page params[:page]
+    @page_size = ResourcePicture.page_size params[:page_size]
+    @resource_pictures = ResourcePicture.list({}, @page, @page_size)
 
     respond_to do |format|
       format.html # index.html.erb
-      format.json { render :json => @resource_pictures.to_json(
-        :include => [:original_picture, :artist, :license]
-      ) }
+      format.json { render :json => @resource_pictures.to_json(ResourcePicture.list_json_opt) }
     end
   end
 
   # GET /resource_pictures/1
   # GET /resource_pictures/1.json
   def show
-    @resource_picture = ResourcePicture.find(params[:id])
+    @resource_picture = ResourcePicture.show(params[:id])
 
     respond_to do |format|
       opt = {:type => @resource_picture.mime_type, :disposition=>"inline"}
@@ -28,10 +26,17 @@ class ResourcePicturesController < ApplicationController
       format.gif { send_data(@resource_picture.restore(params[:subdir]), opt ) }
       format.jpeg { send_data(@resource_picture.restore(params[:subdir]), opt ) }
       format.html # show.html.erb
-      format.json { render json: @resource_picture}
+      format.json { render :json => @resource_picture.to_json(ResourcePicture.list_json_opt)}
     end
   end
 
+  def count
+    @resource_picture = {:count => ResourcePicture.visible_count}
+    respond_to do |format|
+      format.json { render json: @resource_picture.to_json }
+    end
+  end
+  
   def list
     @resource_pictures = ResourcePicture.all
 
index 973be0f..0fe9667 100644 (file)
@@ -2,8 +2,89 @@ class Artist < ActiveRecord::Base
   belongs_to :author
   has_many :original_pictures
   
+  validates :name, :presence => true, :length => {:maximum => 30}
+#  validates :default_license_id, :presence => true, :numericality => true, :existence => true
+  \r
+  before_save do |r|
+    r.supply_default
+  end
+  
+  def supply_default
+  end
+  
   def self.find_by_author author
     Artist.find( :first, :conditions => ['author_id = ?', author.id])
   end
   
+  def self.default_page_size
+    25
+  end
+  
+  def self.max_page_size
+    100
+  end
+  
+  def self.default_panel_size
+    30
+  end
+  
+  def self.max_panel_size
+    200
+  end
+  
+  def self.page prm = nil
+    page = prm.to_i
+    page = 1 if page < 1
+    page
+  end
+  
+  def self.page_size prm = self.default_page_size
+    page_size = prm.to_i
+    page_size = self.max_page_size if page_size > self.max_page_size
+    page_size = self.default_page_size if page_size < 1
+    page_size
+  end
+  
+  def self.offset cnt, prm = nil
+    offset = prm.to_i
+    offset = cnt - 1 if offset >= cnt
+    offset = cnt - offset.abs if offset < 0
+    offset = 0 if offset < 0
+    offset
+  end
+  
+  def self.list opt = {}, page = 1, page_size = self.default_page_size
+    opt.merge!(self.list_opt) unless opt[:include]
+    opt.merge!({:order => 'updated_at desc', :limit => page_size, :offset => (page -1) * page_size})
+    Artist.find(:all, opt)
+  end
+  
+  def self.list_opt
+    {:include => :author}
+  end
+  
+  def self.list_json_opt
+    {:include => :author}
+  end
+  
+  def self.show aid, opt = {}
+    a = Artist.find(aid, :include => self.show_include_opt(opt))
+#    raise ActiveRecord::Forbidden unless c.visible?(au)
+    a
+  end
+  
+  def self.show_include_opt opt = {}
+    res = [:author]
+    res.push(opt[:include]) if opt[:include]
+    res
+  end
+  
+  def self.show_json_include_opt
+    {:include => :author}
+  end
+  
+  def self.visible_count
+    Artist.count
+  end
+  
 end
index 7148ef0..1709ac2 100644 (file)
@@ -2,6 +2,8 @@ class Author < ActiveRecord::Base
   has_one :artist
   belongs_to :user
   
+  validates :name, :length => {:maximum => 30}
+  
   before_save do |r|
     r.name = 'no name' if r.name.blank?
   end
@@ -15,4 +17,75 @@ class Author < ActiveRecord::Base
     self.save
   end
   
+  def self.default_page_size
+    25
+  end
+  
+  def self.max_page_size
+    100
+  end
+  
+  def self.default_panel_size
+    30
+  end
+  
+  def self.max_panel_size
+    200
+  end
+  
+  def self.page prm = nil
+    page = prm.to_i
+    page = 1 if page < 1
+    page
+  end
+  
+  def self.page_size prm = self.default_page_size
+    page_size = prm.to_i
+    page_size = self.max_page_size if page_size > self.max_page_size
+    page_size = self.default_page_size if page_size < 1
+    page_size
+  end
+  
+  def self.offset cnt, prm = nil
+    offset = prm.to_i
+    offset = cnt - 1 if offset >= cnt
+    offset = cnt - offset.abs if offset < 0
+    offset = 0 if offset < 0
+    offset
+  end
+  
+  def self.list opt = {}, page = 1, page_size = self.default_page_size
+    opt.merge!(self.list_opt) unless opt[:include]
+    opt.merge!({:order => 'updated_at desc', :limit => page_size, :offset => (page -1) * page_size})
+    Author.find(:all, opt)
+  end
+  
+  def self.list_opt
+    {:include => :artist}
+  end
+  
+  def self.list_json_opt
+    {:include => :artist}
+  end
+  
+  def self.show aid, opt = {}
+    a = Author.find(aid, :include => self.show_include_opt(opt))
+#    raise ActiveRecord::Forbidden unless c.visible?(au)
+    a
+  end
+  
+  def self.show_include_opt opt = {}
+    res = [:artist]
+    res.push(opt[:include]) if opt[:include]
+    res
+  end
+  
+  def self.show_json_include_opt
+    {:include => :artist}
+  end
+  
+  def self.visible_count
+    Author.count
+  end
+  
 end
index e3cb3c0..3dc6bae 100644 (file)
@@ -71,7 +71,7 @@ class Comic < ActiveRecord::Base
     offset
   end
   
-  def self.count cnt, prm = self.default_panel_size
+  def self.panel_count cnt, prm = self.default_panel_size
     count = prm.to_i
     count = self.max_panel_size if count > self.max_panel_size
     count = self.default_panel_size if count < 1
index 834ee88..d480437 100644 (file)
@@ -15,4 +15,12 @@ class CommonLicense < ActiveRecord::Base
     res
   end
   
+  def self.import_file(filename)
+    t = File.open(filename, 'r').read
+    j = JSON.parse t
+    l = CommonLicense.new j
+    l.save_save
+    p l.id
+  end
+  
 end
index 13e117c..f719af1 100644 (file)
@@ -19,4 +19,47 @@ class PanelPicture < ActiveRecord::Base
     '/resource_pictures/' + filename
   end
   
+  def self.default_page_size
+    25
+  end
+  
+  def self.max_page_size
+    100
+  end
+  
+  def self.page prm = nil
+    page = prm.to_i
+    page = 1 if page < 1
+    page
+  end
+  
+  def self.page_size prm = self.default_page_size
+    page_size = prm.to_i
+    page_size = self.max_page_size if page_size > self.max_page_size
+    page_size = self.default_page_size if page_size < 1
+    page_size
+  end
+  
+  def self.offset cnt, prm = nil
+    offset = prm.to_i
+    offset = cnt - 1 if offset >= cnt
+    offset = cnt - offset.abs if offset < 0
+    offset = 0 if offset < 0
+    offset
+  end
+  
+  def self.list opt = {}, page = 1, page_size = self.default_page_size
+    opt.merge!(self.list_opt) unless opt[:include]
+    opt.merge!({:order => 'updated_at desc', :limit => page_size, :offset => (page -1) * page_size})
+    PanelPicture.find(:all, opt)
+  end
+  
+  def self.list_opt
+    {:include => [:panel, {:resource_picture => [:artist, :license]}]}
+  end
+  
+  def self.list_json_opt
+    {:include => {:panel => {}, :resource_picture => [:artist, :license]}}
+  end
+  
 end
index 346f65f..68ce690 100644 (file)
@@ -135,4 +135,67 @@ class ResourcePicture < ActiveRecord::Base
     PictureIO.resource_picture_io.get self.filename, subdir
   end
   
+  def self.default_page_size
+    25
+  end
+  
+  def self.max_page_size
+    100
+  end
+  
+  def self.page prm = nil
+    page = prm.to_i
+    page = 1 if page < 1
+    page
+  end
+  
+  def self.page_size prm = self.default_page_size
+    page_size = prm.to_i
+    page_size = self.max_page_size if page_size > self.max_page_size
+    page_size = self.default_page_size if page_size < 1
+    page_size
+  end
+  
+  def self.offset cnt, prm = nil
+    offset = prm.to_i
+    offset = cnt - 1 if offset >= cnt
+    offset = cnt - offset.abs if offset < 0
+    offset = 0 if offset < 0
+    offset
+  end
+  
+  def self.list opt = {}, page = 1, page_size = self.default_page_size
+    opt.merge!(self.list_opt) unless opt[:include]
+    opt.merge!({:order => 'updated_at desc', :limit => page_size, :offset => (page -1) * page_size})
+    ResourcePicture.find(:all, opt)
+  end
+  
+  def self.list_opt
+    {:include => [:artist, :license]}
+  end
+  
+  def self.list_json_opt
+    {:include => [:artist, :license]}
+  end
+  
+  def self.show rid, opt = {}
+    r = ResourcePicture.find(rid, :include => self.show_include_opt(opt))
+#    raise ActiveRecord::Forbidden unless c.visible?(au)
+    r
+  end
+  
+  def self.show_include_opt opt = {}
+    res = [:artist, :license]
+    res.push(opt[:include]) if opt[:include]
+    res
+  end
+  
+  def self.show_json_include_opt
+    {:include => [:artist, :license]}
+  end
+  
+  def self.visible_count
+    ResourcePicture.count
+  end
+  
 end
index 8c8712e..09af089 100644 (file)
@@ -3,7 +3,7 @@
 <head>
   <title>Pettanr</title>
   <%= stylesheet_link_tag    "application" %>
-  <%= javascript_include_tag "application" %>
+  <%# javascript_include_tag "application" %>
   <%= csrf_meta_tags %>
 </head>
 <body>
index 2e6f5f6..89927c1 100644 (file)
@@ -1,6 +1,16 @@
-<p>このシステムには管理者が設定されていません。</p>
-<p>次のコマンドで管理者アカウントを作成してください。</p>
+<% if Admin.count.to_i == 0 %>
+  <p>このシステムには管理者が設定されていません。</p>
+  <p>次のコマンドで管理者アカウントを作成してください。</p>
 
-<div style="background-color: #dddddd">
-rails r "Admin.start('admin@mail.adr.ess', 'admin_password')"
-</div>
+  <div style="background-color: #dddddd">
+  rails r "Admin.start('admin@mail.adr.ess', 'admin_password')"
+  </div>
+<% end %>
+<% if License.count.to_i == 0 %>
+  <p>このシステムにはライセンスが設定されていません。</p>
+  <p>次のコマンドでライセンスを作成してください。</p>
+
+  <div style="background-color: #dddddd">
+  rails r "CommonLicense.import_file('filename.json')"
+  </div>
+<% end %>
diff --git a/autotest/discover.rb b/autotest/discover.rb
new file mode 100644 (file)
index 0000000..cd6892c
--- /dev/null
@@ -0,0 +1 @@
+Autotest.add_discovery { "rspec2" }
index a7b5341..76eded7 100644 (file)
@@ -9,6 +9,7 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
       post :create
       get :list
       get :browse
@@ -22,6 +23,7 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
       post :create
       get :list
       get :browse
@@ -98,6 +100,7 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
       get :list
       get :browse
     end
@@ -123,6 +126,7 @@ Pettanr::Application.routes.draw do
     collection do
       get :index
       get :show
+      get :count
       post :create
       get :list
       get :browse
diff --git a/db/common_licenses.json b/db/common_licenses.json
new file mode 100644 (file)
index 0000000..20889eb
--- /dev/null
@@ -0,0 +1,12 @@
+{\r
+  "name": "Public Domain", \r
+  "url": "http://ja.wikipedia.org/wiki/%E3%83%91%E3%83%96%E3%83%AA%E3%83%83%E3%82%AF%E3%83%89%E3%83%A1%E3%82%A4%E3%83%B3", \r
+  "cc_by": 0, \r
+  "cc_sa": 0, \r
+  "cc_nd": 0, \r
+  "cc_nc": 0, \r
+  "no_resize": 0, \r
+  "no_flip": 0, \r
+  "no_convert": 0, \r
+  "keep_aspect_ratio": 0\r
+}\r
index 85160df..daaf866 100644 (file)
@@ -33,44 +33,48 @@ class PictureIO
     end
     
     def exist?(filename, subdir = nil)
+      res = true
       begin
-        File.exist?(dir(subdir) + filename)
-      rescue StandardError
-        false
+        res = File.exist?(dir(subdir) + filename)
+      rescue
+        res = false
       end
+      res
     end
     
     def put(bindata, filename, subdir = nil)
-      mkdir subdir
+      res = true
       begin
-        open(dir(subdir) + filename, 'wb') do |f|
+        mkdir subdir
+        File.open(dir(subdir) + filename, 'wb') do |f|
           f.write bindata
         end
-        true
-      rescue StandardError
-        false
+      rescue
+        res = false
       end
+      res
     end
     
     def get(filename, subdir = nil)
       bindata = ''
       begin
-        open(dir(subdir) + filename, 'rb') do |f|
+        File.open(dir(subdir) + filename, 'rb') do |f|
           bindata += f.read
         end
-        bindata
-      rescue StandardError
-        false
+      rescue
+        bindata = false
       end
+      bindata
     end
     
     def delete(filename, subdir = nil)
+      res = true
       begin
         File.delete(dir(subdir) + filename)
-        true
-      rescue StandardError
-        false
+      rescue
+        res = false
       end
+      res
     end
     
   end
index c4c8a76..4985a54 100644 (file)
@@ -28,44 +28,46 @@ class PictureIO
     end
     
     def exist?(filename, subdir = nil)
+      res = true
       begin
-        AWS::S3::S3Object.exist?(dir(subdir) + filename)
-        true
-      rescue S3Exception
-        false
+        res = AWS::S3::S3Object.exist?(dir(subdir) + filename, base)
+      rescue
+        res = false
       end
+      res
     end
     
     def put(bindata, filename, subdir = nil)
+      res = true
       begin
         AWS::S3::S3Object.store(dir(subdir) + filename, bindata, base)
-        true
-      rescue S3Exception
-        false
+      rescue
+        res = false
       end
+      res
     end
     
     def get(filename, subdir = nil)
+      bindata = ''
       begin
-        bindata = ''
-    #      if AWS::S3::S3Object.exists?(fn, 'pettanr')
         AWS::S3::S3Object.stream(dir(subdir) + filename, base) do |st|
           bindata += st if st
         end
-        bindata
-      rescue S3Exception
-        false
+      rescue
+        bindata = false
       end
+      bindata
     end
     
     def delete(filename, subdir = nil)
+      res = true
       begin
         AWS::S3::S3Object.delete(dir(subdir) + filename, base)
-#        true
-      rescue S3Exception
-        false
+      rescue
+        res = false
       end
-    end
+      res
+  end
     
   end
 end
diff --git a/lib/test/local_picture_spec.rb b/lib/test/local_picture_spec.rb
new file mode 100644 (file)
index 0000000..2be6b6a
--- /dev/null
@@ -0,0 +1,162 @@
+# -*- encoding: utf-8 -*-
+#ファイル保存
+require 'local_picture'
+require 'spec_helper'
+
+#テスト用ファイルをクリアしておく
+@path = Rails.root + 'lib/test/temp/'
+Dir.glob @path + '*' do |filename|
+  if File.directory?(filename)
+    Dir.glob filename do |filename2|
+      File.delete(filename2) unless File.directory?(filename2)
+    end
+  else
+    File.delete(filename)
+  end
+end
+describe PictureIO::LocalPicture do
+  before do
+    @path = Rails.root + 'lib/test/temp/'
+    @io = PictureIO::LocalPicture.new @path
+  end
+
+  describe 'サブディレクトリに於いて' do
+    it '配列が返る' do
+      PictureIO::LocalPicture.subdirs.is_a?(Array).should be_true 
+    end
+
+    it 'カレント、サムネ、水平反転、垂直反転、水平垂直反転が返る' do
+      PictureIO::LocalPicture.subdirs.size.should eq 5
+      PictureIO::LocalPicture.subdirs.include?('').should eq true
+      PictureIO::LocalPicture.subdirs.include?('v').should eq true
+      PictureIO::LocalPicture.subdirs.include?('h').should eq true
+      PictureIO::LocalPicture.subdirs.include?('vh').should eq true
+      PictureIO::LocalPicture.subdirs.include?('thumbnail').should eq true
+    end
+  end
+  
+  describe 'ファイル存在確認に於いて' do
+    before do
+    end
+    context 'ファイルがあるとき' do
+      it 'trueが返る' do
+        File.open @path + 'exist', 'w' do |f|
+          f.puts 'test data'
+        end
+        @io.exist?('exist').should be_true
+      end
+    end
+    context 'ファイルがないとき' do
+      it 'falseが返る' do
+        @io.exist?('not.exist').should be_false
+      end
+    end
+  end
+  
+  describe 'ファイル取得に於いて' do
+    before do
+      File.open @path + 'test.get', 'w' do |f|
+        f.puts 'basedata'
+      end
+      File.open @path + 'v/testsub.get', 'w' do |f|
+        f.puts 'subdata'
+      end
+    end
+    context 'ベースディレクトリから取るとき' do
+      it 'basedataが返る' do
+        @io.get('test.get').should match /basedata/
+      end
+    end
+    context 'サブディレクトリvから取るとき' do
+      it 'subdataが返る' do
+        @io.get('testsub.get', 'v').should match /subdata/
+      end
+    end
+    context '例外が発生するとき' do
+      it 'falseが返る' do
+        File.stub(:open).with(any_args()).and_raise(StandardError)
+        @io.get('test.get').should be_false
+      end
+    end
+  end
+  
+  describe 'ファイル作成に於いて' do
+    before do
+      File.open @path + 'test.put', 'w' do |f|
+        f.puts 'already'
+      end
+    end
+    context 'ベースディレクトリに作成するとき' do
+      before do
+        @io.put('created', 'create.put')
+      end
+      it 'ファイルが作成されている' do
+        File.exist?(@path + 'create.put').should be_true
+      end
+      it 'createdが書きこまれている' do
+        d = File.open(@path + 'create.put').read
+        d.should match /create/
+      end
+    end
+    context '既存ファイルを更新するとき' do
+      before do
+        @io.put('overwrited', 'test.put')
+      end
+      it 'overwritedが書きこまれている' do
+        d = File.open(@path + 'test.put').read
+        d.should match /overwrited/
+      end
+      it '上書きされている' do
+        d = File.open(@path + 'test.put').read
+        d.should_not match /already/
+      end
+    end
+    context 'サブディレクトリhに作成するとき' do
+      before do
+        @io.put('subdirtest', 'testsub.put', 'h')
+      end
+      it 'ファイルが作成されている' do
+        File.exist?(@path + 'h/testsub.put').should be_true
+      end
+      it 'subdirtestが書きこまれている' do
+        d = File.open(@path + 'h/testsub.put').read
+        d.should match /subdirtest/
+      end
+    end
+    context '例外が発生するとき' do
+      it 'falseが返る' do
+        File.stub(:open).with(any_args()).and_raise(StandardError)
+        @io.put('bindata', 'test.put').should be_false
+      end
+    end
+  end
+  
+  describe 'ファイル削除に於いて' do
+    before do
+      File.open @path + 'test.del', 'w' do |f|
+        f.puts 'basedata'
+      end
+      File.open @path + 'thumbnail/testsub.del', 'w' do |f|
+        f.puts 'subdata'
+      end
+    end
+    context 'ベースディレクトリから削除するとき' do
+      it 'ファイルが削除されている' do
+        @io.delete('test.del')
+        File.exist?(@path + 'test.del').should be_false
+      end
+    end
+    context 'サブディレクトリthumbnailから削除するとき' do
+      it 'ファイルが削除されている' do
+        @io.delete('testsub.del', 'thumbnail')
+        File.exist?(@path + 'thumbnail/testsub.del').should be_false
+      end
+    end
+    context '例外が発生するとき' do
+      it 'falseが返る' do
+        File.stub(:delete).with(any_args()).and_raise(StandardError)
+        @io.delete('test.del.not.exist').should be_false
+      end
+    end
+  end
+end
diff --git a/lib/test/s3_picture_spec.rb b/lib/test/s3_picture_spec.rb
new file mode 100644 (file)
index 0000000..5d8eee7
--- /dev/null
@@ -0,0 +1,151 @@
+# -*- encoding: utf-8 -*-
+#ファイル保存
+require 's3_picture'
+require 'spec_helper'
+
+#テスト用ファイルをクリアしておく
+@path = Rails.root + 'lib/test/temp/'
+Dir.glob @path + '*' do |filename|
+  if File.directory?(filename)
+    Dir.glob filename do |filename2|
+      File.delete(filename2) unless File.directory?(filename2)
+    end
+  else
+    File.delete(filename)
+  end
+end
+describe PictureIO::S3Picture do
+  before do
+    @path = 'test'
+    @io = PictureIO::S3Picture.new @path
+  end
+
+  describe 'サブディレクトリに於いて' do
+    it '配列が返る' do
+      PictureIO::S3Picture.subdirs.is_a?(Array).should be_true 
+    end
+
+    it 'カレント、サムネ、水平反転、垂直反転、水平垂直反転が返る' do
+      PictureIO::S3Picture.subdirs.size.should eq 5
+      PictureIO::S3Picture.subdirs.include?('').should eq true
+      PictureIO::S3Picture.subdirs.include?('v').should eq true
+      PictureIO::S3Picture.subdirs.include?('h').should eq true
+      PictureIO::S3Picture.subdirs.include?('vh').should eq true
+      PictureIO::S3Picture.subdirs.include?('thumbnail').should eq true
+    end
+  end
+  
+  describe 'ファイル存在確認に於いて' do
+    before do
+      AWS::S3::S3Object.stub(:exist?).with(any_args).and_return(true)
+    end
+    context 'ベースディレクトリから取るとき' do
+      it 'S3に依頼している' do
+        testname = 'exist'
+        AWS::S3::S3Object.should_receive(:exist?).with(testname, @path).exactly(1)
+        @io.exist?(testname)
+      end
+    end
+    context 'サブディレクトリvから取るとき' do
+      it 'S3に依頼している' do
+        testname = 'exist'
+        subd = 'v'
+        AWS::S3::S3Object.should_receive(:exist?).with(subd + '/' + testname, @path).exactly(1)
+        @io.exist?(testname, subd)
+      end
+    end
+    context '例外が発生するとき' do
+      it 'falseが返る' do
+        AWS::S3::S3Object.stub(:exist?).with(any_args()).and_raise(StandardError)
+        @io.exist?('test.get').should be_false
+      end
+    end
+  end
+  
+  describe 'ファイル取得に於いて' do
+    before do
+    end
+    context 'ベースディレクトリから取るとき' do
+      it 'S3に依頼している' do
+        testname = 'test.get'
+        AWS::S3::S3Object.should_receive(:stream).with(testname, @path).exactly(1)
+        @io.get(testname)
+      end
+      it 'データが返る' do
+        AWS::S3::S3Object.stub(:stream).with(any_args()).and_yield('data')
+        @io.get('test.get').should eq 'data'
+      end
+    end
+    context 'サブディレクトリvから取るとき' do
+      it 'S3に依頼している' do
+        testname = 'test.get'
+        subd = 'v'
+        AWS::S3::S3Object.should_receive(:stream).with(subd + '/' + testname, @path).exactly(1)
+        @io.get(testname, subd)
+      end
+      it 'データが返る' do
+        subd = 'v'
+        AWS::S3::S3Object.stub(:stream).with(any_args()).and_yield('data')
+        @io.get('test.get', subd).should eq 'data'
+      end
+    end
+    context '例外が発生するとき' do
+      it 'falseが返る' do
+        AWS::S3::S3Object.stub(:get).with(any_args()).and_raise(StandardError)
+        @io.get('test.get').should be_false
+      end
+    end
+  end
+  
+  describe 'ファイル作成に於いて' do
+    before do
+    end
+    context 'ベースディレクトリに作成するとき' do
+      it 'S3に依頼している' do
+        testname = 'create'
+        AWS::S3::S3Object.should_receive(:store).with(testname, 'bindata', @path).exactly(1)
+        @io.put('bindata', testname)
+      end
+    end
+    context 'サブディレクトリvに作成するとき' do
+      it 'S3に依頼している' do
+        testname = 'create'
+        subd = 'h'
+        AWS::S3::S3Object.should_receive(:store).with(subd + '/' + testname, 'bindata', @path).exactly(1)
+        @io.put('bindata', testname, subd)
+      end
+    end
+    context '例外が発生するとき' do
+      it 'falseが返る' do
+        AWS::S3::S3Object.stub(:store).with(any_args()).and_raise(StandardError)
+        @io.put('bindata', 'test.put').should be_false
+      end
+    end
+  end
+  
+  describe 'ファイル削除に於いて' do
+    before do
+    end
+    context 'ベースディレクトリから削除するとき' do
+      it 'S3に依頼している' do
+        testname = 'destroy'
+        AWS::S3::S3Object.should_receive(:delete).with(testname, @path).exactly(1)
+        @io.delete(testname)
+      end
+    end
+    context 'サブディレクトリvhから削除するとき' do
+      it 'S3に依頼している' do
+        testname = 'destroy'
+        subd = 'vh'
+        AWS::S3::S3Object.should_receive(:delete).with(subd + '/' + testname, @path).exactly(1)
+        @io.delete(testname, subd)
+      end
+    end
+    context '例外が発生するとき' do
+      it 'falseが返る' do
+        AWS::S3::S3Object.stub(:delete).with(any_args()).and_raise(StandardError)
+        @io.delete('test.del.not.exist').should be_false
+      end
+    end
+  end
+end
diff --git a/spec/controllers/app_controller_spec.rb b/spec/controllers/app_controller_spec.rb
new file mode 100644 (file)
index 0000000..7a87973
--- /dev/null
@@ -0,0 +1,124 @@
+# -*- encoding: utf-8 -*-
+#ライセンス
+require 'spec_helper'
+
+describe SystemController do
+  before do
+  end
+
+  describe 'システム初期化要請に於いて' do
+    context '要請の必要がないとき' do
+      before do
+        #要請の必要がない=管理者登録済み かつ ライセンス登録済み
+        Factory :admin
+        Factory :license
+      end
+      it 'リクエスト通りのページを開く' do
+        get :index
+        response.should_not redirect_to 'system/start'
+      end
+      context 'userがサインインしているなら' do
+        before do
+          @user = Factory( :user_yas)
+          @author = @user.author
+          sign_in @user
+        end
+        it 'userにサインイン中のアカウントをセットしている' do
+          get :index
+          assigns(:user).should eq @user
+        end
+        it 'authorに作家をセットしている' do
+          get :index
+          assigns(:author).should eq @author
+        end
+        it 'artistに絵師をセットしている' do
+          @artist = Factory :artist_yas, :author_id => @author.id
+          get :index
+          assigns(:artist).should eq @artist
+        end
+        it 'ただし、絵師登録されてなければ新規の絵師をセットしている' do
+          get :index
+          assigns(:artist).should be_a_new(Artist)
+        end
+      end
+      context 'userがサインインしていないなら' do
+        before do
+          @user = Factory( :user_yas)
+          @author = @user.author
+          @artist = Factory :artist_yas, :author_id => @author.id
+        end
+        it 'userが空になっている' do
+          get :index
+          assigns(:user).should eq nil
+        end
+        it 'authorが空になっている' do
+          get :index
+          assigns(:author).should eq nil
+        end
+        it 'artistが空になっている' do
+          get :index
+          assigns(:artist).should eq nil
+        end
+      end
+    end
+    #要請の必要がある=管理者がいない または ライセンスがない
+    context '管理者がいないとき' do
+      before do
+        Factory :license
+      end
+      context '本機能を開こうとしているなら' do
+        it '初期化要請ページに遷移する' do
+          get :index
+          response.should redirect_to '/system/start'
+        end
+        it 'ステータスコード302 Foundを返す' do
+          get :index
+          response.status.should eq 302
+        end
+      end
+      context '初期化要請ページを開こうとしているなら' do
+        it '遷移しない' do
+          get :start
+          response.should_not redirect_to 'system/start'
+        end
+        it 'ステータスOkを返す' do
+          get :start
+          response.status.should eq 200
+        end
+        it '初期化要請ページを描画する' do
+          get :start
+          response.should render_template("system/start")
+        end
+      end
+    end
+    context 'ライセンスがないとき' do
+      before do
+        Factory :admin
+      end
+      context '本機能を開こうとしているなら' do
+        it '初期化要請ページに遷移する' do
+          get :index
+          response.should redirect_to '/system/start'
+        end
+        it 'ステータスコード302 Foundを返す' do
+          get :index
+          response.status.should eq 302
+        end
+      end
+      context '初期化要請ページを開こうとしているなら' do
+        it '遷移しない' do
+          get :start
+          response.should_not redirect_to 'system/start'
+        end
+        it 'ステータスOkを返す' do
+          get :start
+          response.status.should eq 200
+        end
+        it '初期化要請ページを描画する' do
+          get :start
+          response.should render_template("system/start")
+        end
+      end
+    end
+  end
+end
index ea5123d..e0db667 100644 (file)
+# -*- encoding: utf-8 -*-
 require 'spec_helper'
-
-# This spec was generated by rspec-rails when you ran the scaffold generator.
-# It demonstrates how one might use RSpec to specify the controller code that
-# was generated by Rails when you ran the scaffold generator.
-#
-# It assumes that the implementation code is generated by the rails scaffold
-# generator.  If you are using any extension libraries to generate different
-# controller code, this generated spec may or may not pass.
-#
-# It only uses APIs available in rails and/or rspec-rails.  There are a number
-# of tools you can use to make these specs even more expressive, but we're
-# sticking to rails and rspec-rails APIs to keep things simple and stable.
-#
-# Compared to earlier versions of this generator, there is very limited use of
-# stubs and message expectations in this spec.  Stubs are only used when there
-# is no simpler way to get a handle on the object needed for the example.
-# Message expectations are only used when there is no simpler way to specify
-# that an instance is receiving a specific message.
+#絵師
 
 describe ArtistsController do
-
-  # This should return the minimal set of attributes required to create a valid
-  # Artist. As you add validations to Artist, be sure to
-  # update the return value of this method accordingly.
-  def valid_attributes
-    {}
+  before do
+    Factory :admin
+    @license = Factory :license
+    @user = Factory( :user_yas)
+    @author = @user.author
+    @artist = Factory :artist_yas, :author_id => @author.id
   end
-
-  describe "GET index" do
-    it "assigns all artists as @artists" do
-      artist = Artist.create! valid_attributes
-      get :index
-      assigns(:artists).should eq([artist])
+  
+  describe '一覧表示に於いて' do
+    before do
+      Artist.stub(:list).and_return([@artist, @artist, @artist])
+      sign_in @user
     end
-  end
-
-  describe "GET show" do
-    it "assigns the requested artist as @artist" do
-      artist = Artist.create! valid_attributes
-      get :show, :id => artist.id
-      assigns(:artist).should eq(artist)
+    context '事前チェックする' do
+      it '与えられたpageがセットされている' do
+        get :index, :page => 5
+        assigns(:page).should eq 5
+      end
+      it '省略されると@pageに1値が入る' do
+        get :index
+        assigns(:page).should eq 1
+      end
+      it '与えられたpage_sizeがセットされている' do
+        get :index, :page_size => 15
+        assigns(:page_size).should eq 15
+      end
+      it '省略されると@page_sizeにデフォルト値が入る' do
+        get :index
+        assigns(:page_size).should eq Artist.default_page_size
+      end
+      it '最大を超えると@page_sizeにデフォルト最大値が入る' do
+        get :index, :page_size => 1500
+        assigns(:page_size).should eq Artist.max_page_size
+      end
+      it '不正な値が入ると@page_sizeにデフォルト最大値が入る' do
+        get :index, :page_size => 0
+        assigns(:page_size).should eq Artist.default_page_size
+      end
     end
-  end
-
-  describe "GET new" do
-    it "assigns a new artist as @artist" do
-      get :new
-      assigns(:artist).should be_a_new(Artist)
+    context 'つつがなく終わるとき' do
+      it 'ステータスコード200 OKを返す' do
+        get :index
+        response.should be_success 
+      end
+      it '絵師モデルに一覧を問い合わせている' do
+        Artist.should_receive(:list).exactly(1)
+        get :index
+      end
+      it '@artistsにリストを取得している' do
+        get :index
+        assigns(:artists).should have_at_least(3).items
+      end
+      context 'html形式' do
+        it 'indexテンプレートを描画する' do
+          get :index
+          response.should render_template("index")
+        end
+      end
+      context 'json形式' do
+        it 'jsonデータを返す' do
+          get :index, :format => :json
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
+        end
+        it 'データがリスト構造になっている' do
+          get :index, :format => :json
+          json = JSON.parse response.body
+          json.should have_at_least(3).items
+        end
+        it 'リストの先頭くらいは絵師っぽいものであって欲しい' do
+          get :index, :format => :json
+          json = JSON.parse response.body
+          json.first.has_key?("name").should be_true
+        end
+      end
     end
-  end
-
-  describe "GET edit" do
-    it "assigns the requested artist as @artist" do
-      artist = Artist.create! valid_attributes
-      get :edit, :id => artist.id
-      assigns(:artist).should eq(artist)
+    context '作家権限がないとき' do
+      before do
+        sign_out @user
+      end
+      context 'html形式' do
+        it 'ステータスコード302 Foundを返す' do
+          get :index
+          response.status.should eq 302
+        end
+        it 'サインインページへ遷移する' do
+          get :index
+          response.should redirect_to '/users/sign_in'
+        end
+      end
+      context 'json形式' do
+        it 'ステータスコード401 Unauthorizedを返す' do
+          get :index, :format => :json
+          response.status.should eq 401
+        end
+        it '応答メッセージにUnauthorizedを返す' do
+          get :index, :format => :json
+          response.message.should match(/Unauthorized/)
+        end
+      end
     end
   end
-
-  describe "POST create" do
-    describe "with valid params" do
-      it "creates a new Artist" do
-        expect {
-          post :create, :artist => valid_attributes
-        }.to change(Artist, :count).by(1)
+  
+  describe '閲覧に於いて' do
+    before do
+      Artist.stub(:show).and_return(@artist)
+      sign_in @user
+    end
+    context 'つつがなく終わるとき' do
+      it 'ステータスコード200 OKを返す' do
+        get :show, :id => @artist.id
+        response.should be_success
       end
-
-      it "assigns a newly created artist as @artist" do
-        post :create, :artist => valid_attributes
-        assigns(:artist).should be_a(Artist)
-        assigns(:artist).should be_persisted
+      it '絵師モデルに単体取得を問い合わせている' do
+        Artist.should_receive(:show).exactly(1)
+        get :show
       end
-
-      it "redirects to the created artist" do
-        post :create, :artist => valid_attributes
-        response.should redirect_to(Artist.last)
+      it '@artistにアレを取得している' do
+        get :show, :id => @artist.id
+        assigns(:artist).should eq(@artist)
       end
-    end
-
-    describe "with invalid params" do
-      it "assigns a newly created but unsaved artist as @artist" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        Artist.any_instance.stub(:save).and_return(false)
-        post :create, :artist => {}
-        assigns(:artist).should be_a_new(Artist)
+      context 'html形式' do
+        it 'showテンプレートを描画する' do
+          get :show, :id => @artist.id
+          response.should render_template("show")
+        end
       end
-
-      it "re-renders the 'new' template" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        Artist.any_instance.stub(:save).and_return(false)
-        post :create, :artist => {}
-        response.should render_template("new")
+      context 'json形式' do
+        it 'jsonデータを返す' do
+          get :show, :id => @artist.id, :format => :json
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
+        end
+        it 'データがアレになっている' do
+          get :show, :id => @artist.id, :format => :json
+          json = JSON.parse response.body
+          json["name"].should match(/yas/)
+        end
       end
     end
-  end
-
-  describe "PUT update" do
-    describe "with valid params" do
-      it "updates the requested artist" do
-        artist = Artist.create! valid_attributes
-        # Assuming there are no other artists in the database, this
-        # specifies that the Artist created on the previous line
-        # receives the :update_attributes message with whatever params are
-        # submitted in the request.
-        Artist.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
-        put :update, :id => artist.id, :artist => {'these' => 'params'}
+    context '作家権限がないとき' do
+      before do
+        sign_out @user
       end
-
-      it "assigns the requested artist as @artist" do
-        artist = Artist.create! valid_attributes
-        put :update, :id => artist.id, :artist => valid_attributes
-        assigns(:artist).should eq(artist)
+      context 'html形式' do
+        it 'ステータスコード302 Foundを返す' do
+          get :show, :id => @artist.id
+          response.status.should eq 302
+        end
+        it 'サインインページへ遷移する' do
+          get :show, :id => @artist.id
+          response.body.should redirect_to '/users/sign_in'
+        end
       end
-
-      it "redirects to the artist" do
-        artist = Artist.create! valid_attributes
-        put :update, :id => artist.id, :artist => valid_attributes
-        response.should redirect_to(artist)
+      context 'json形式' do
+        it 'ステータスコード401 Unauthorizedを返す' do
+          get :show, :id => @artist.id, :format => :json
+          response.status.should eq 401
+        end
+        it '応答メッセージにUnauthorizedを返す' do
+          get :show, :id => @artist.id, :format => :json
+          response.message.should match(/Unauthorized/)
+        end
       end
     end
-
-    describe "with invalid params" do
-      it "assigns the artist as @artist" do
-        artist = Artist.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        Artist.any_instance.stub(:save).and_return(false)
-        put :update, :id => artist.id, :artist => {}
-        assigns(:artist).should eq(artist)
+=begin
+    context '対象作家がないとき' do
+      context 'html形式' do
+        it '例外404 not_foundを返す' do
+          lambda{
+            get :show, :id => 0
+          }.should raise_error(ActiveRecord::RecordNotFound)
+        end
       end
-
-      it "re-renders the 'edit' template" do
-        artist = Artist.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        Artist.any_instance.stub(:save).and_return(false)
-        put :update, :id => artist.id, :artist => {}
-        response.should render_template("edit")
+      context 'json形式' do
+        it '例外404 not_foundを返す' do
+          lambda{ 
+            get :show, :id => 0, :format => :json
+          }.should raise_error(ActiveRecord::RecordNotFound)
+        end
       end
     end
+=end
   end
-
-  describe "DELETE destroy" do
-    it "destroys the requested artist" do
-      artist = Artist.create! valid_attributes
-      expect {
-        delete :destroy, :id => artist.id
-      }.to change(Artist, :count).by(-1)
+  
+  describe '絵師数取得に於いて' do
+    before do
+      Artist.should_receive(:visible_count).and_return(3)
+#      sign_in @user
     end
-
-    it "redirects to the artists list" do
-      artist = Artist.create! valid_attributes
-      delete :destroy, :id => artist.id
-      response.should redirect_to(artists_url)
+    context 'つつがなく終わるとき' do
+      it 'ステータスコード200 OKを返す' do
+        get :count, :format => :json
+        response.should be_success 
+      end
+      context 'json形式' do
+        it 'jsonデータを返す' do
+          get :count, :format => :json
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
+        end
+        it 'データがHash構造になっていてコミック数が1である' do
+          get :count, :format => :json
+          json = JSON.parse response.body
+          json["count"].should == 3
+        end
+      end
     end
   end
 
diff --git a/spec/controllers/authors/sessions_controller_spec.rb b/spec/controllers/authors/sessions_controller_spec.rb
deleted file mode 100644 (file)
index 0982484..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-require 'spec_helper'
-
-describe Authors::SessionsController do
-
-end
index c09f3d9..6adf689 100644 (file)
@@ -1,5 +1,213 @@
+# -*- encoding: utf-8 -*-
 require 'spec_helper'
+#作家
 
 describe AuthorsController do
+  before do
+    Factory :admin
+    @license = Factory :license
+    @user = Factory( :user_yas)
+    @author = @user.author
+    @artist = Factory :artist_yas, :author_id => @author.id
+  end
+
+  describe '一覧表示に於いて' do
+    before do
+      Author.stub(:list).and_return([@author, @author, @author])
+      sign_in @user
+    end
+    context '事前チェックする' do
+      it '与えられたpageがセットされている' do
+        get :index, :page => 5
+        assigns(:page).should eq 5
+      end
+      it '省略されると@pageに1値が入る' do
+        get :index
+        assigns(:page).should eq 1
+      end
+      it '与えられたpage_sizeがセットされている' do
+        get :index, :page_size => 15
+        assigns(:page_size).should eq 15
+      end
+      it '省略されると@page_sizeにデフォルト値が入る' do
+        get :index
+        assigns(:page_size).should eq Author.default_page_size
+      end
+      it '最大を超えると@page_sizeにデフォルト最大値が入る' do
+        get :index, :page_size => 1500
+        assigns(:page_size).should eq Author.max_page_size
+      end
+      it '不正な値が入ると@page_sizeにデフォルト最大値が入る' do
+        get :index, :page_size => 0
+        assigns(:page_size).should eq Author.default_page_size
+      end
+    end
+    context 'つつがなく終わるとき' do
+      it 'ステータスコード200 OKを返す' do
+        get :index
+        response.should be_success 
+      end
+      it '作家モデルに一覧を問い合わせている' do
+        Author.should_receive(:list).exactly(1)
+        get :index
+      end
+      it '@authorsにリストを取得している' do
+        get :index
+        assigns(:authors).should have_at_least(3).items
+      end
+      context 'html形式' do
+        it 'indexテンプレートを描画する' do
+          get :index
+          response.should render_template("index")
+        end
+      end
+      context 'json形式' do
+        it 'jsonデータを返す' do
+          get :index, :format => :json
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
+        end
+        it 'データがリスト構造になっている' do
+          get :index, :format => :json
+          json = JSON.parse response.body
+          json.should have_at_least(3).items
+        end
+        it 'リストの先頭くらいは作家っぽいものであって欲しい' do
+          get :index, :format => :json
+          json = JSON.parse response.body
+          json.first.has_key?("name").should be_true
+        end
+      end
+    end
+    context '作家権限がないとき' do
+      before do
+        sign_out @user
+      end
+      context 'html形式' do
+        it 'ステータスコード302 Foundを返す' do
+          get :index
+          response.status.should eq 302
+        end
+        it 'サインインページへ遷移する' do
+          get :index
+          response.should redirect_to '/users/sign_in'
+        end
+      end
+      context 'json形式' do
+        it 'ステータスコード401 Unauthorizedを返す' do
+          get :index, :format => :json
+          response.status.should eq 401
+        end
+        it '応答メッセージにUnauthorizedを返す' do
+          get :index, :format => :json
+          response.message.should match(/Unauthorized/)
+        end
+      end
+    end
+  end
+  
+  describe '閲覧に於いて' do
+    before do
+      Author.stub(:show).and_return(@author)
+      sign_in @user
+    end
+    context 'つつがなく終わるとき' do
+      it 'ステータスコード200 OKを返す' do
+        get :show, :id => @author.id
+        response.should be_success
+      end
+      it '作家モデルに単体取得を問い合わせている' do
+        Author.should_receive(:show).exactly(1)
+        get :show
+      end
+      it '@authorにアレを取得している' do
+        get :show, :id => @author.id
+        assigns(:author).should eq(@author)
+      end
+      context 'html形式' do
+        it 'showテンプレートを描画する' do
+          get :show, :id => @author.id
+          response.should render_template("show")
+        end
+      end
+      context 'json形式' do
+        it 'jsonデータを返す' do
+          get :show, :id => @author.id, :format => :json
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
+        end
+        it 'データがアレになっている' do
+          get :show, :id => @author.id, :format => :json
+          json = JSON.parse response.body
+          json["name"].should match(/name/)
+        end
+      end
+    end
+    context '作家権限がないとき' do
+      before do
+        sign_out @user
+      end
+      context 'html形式' do
+        it 'ステータスコード302 Foundを返す' do
+          get :show, :id => @author.id
+          response.status.should eq 302
+        end
+        it 'サインインページへ遷移する' do
+          get :show, :id => @author.id
+          response.body.should redirect_to '/users/sign_in'
+        end
+      end
+      context 'json形式' do
+        it 'ステータスコード401 Unauthorizedを返す' do
+          get :show, :id => @author.id, :format => :json
+          response.status.should eq 401
+        end
+        it '応答メッセージにUnauthorizedを返す' do
+          get :show, :id => @author.id, :format => :json
+          response.message.should match(/Unauthorized/)
+        end
+      end
+    end
+=begin
+    context '対象作家がないとき' do
+      context 'html形式' do
+        it '例外404 not_foundを返す' do
+          lambda{
+            get :show, :id => 0
+          }.should raise_error(ActiveRecord::RecordNotFound)
+        end
+      end
+      context 'json形式' do
+        it '例外404 not_foundを返す' do
+          lambda{ 
+            get :show, :id => 0, :format => :json
+          }.should raise_error(ActiveRecord::RecordNotFound)
+        end
+      end
+    end
+=end
+  end
+  
+  describe '作家数取得に於いて' do
+    before do
+      Author.should_receive(:visible_count).and_return(3)
+#      sign_in @user
+    end
+    context 'つつがなく終わるとき' do
+      it 'ステータスコード200 OKを返す' do
+        get :count, :format => :json
+        response.should be_success 
+      end
+      context 'json形式' do
+        it 'jsonデータを返す' do
+          get :count, :format => :json
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
+        end
+        it 'データがHash構造になっていてコミック数が1である' do
+          get :count, :format => :json
+          json = JSON.parse response.body
+          json["count"].should == 3
+        end
+      end
+    end
+  end
 
 end
diff --git a/spec/controllers/balloon_templates_controller_spec.rb b/spec/controllers/balloon_templates_controller_spec.rb
new file mode 100644 (file)
index 0000000..3659cbf
--- /dev/null
@@ -0,0 +1,13 @@
+# -*- encoding: utf-8 -*-
+#フキダシ枠テンプレート
+require 'spec_helper'
+
+describe BalloonTemplatesController do
+  describe "GET index" do
+    it "assigns all baloon_templates as @baloon_templates" do
+      baloon_template = BaloonTemplate.create! valid_attributes
+      get :index
+      assigns(:baloon_templates).should eq([baloon_template])
+    end
+  end
+end
diff --git a/spec/controllers/balloons_controller_spec.rb b/spec/controllers/balloons_controller_spec.rb
new file mode 100644 (file)
index 0000000..97ff672
--- /dev/null
@@ -0,0 +1,13 @@
+# -*- encoding: utf-8 -*-
+#フキダシ枠
+require 'spec_helper'
+
+describe BalloonsController do
+  describe "GET index" do
+    it "assigns all baloons as @baloons" do
+      baloon = Baloon.create! valid_attributes
+      get :index
+      assigns(:baloons).should eq([baloon])
+    end
+  end
+end
diff --git a/spec/controllers/baloon_templates_controller_spec.rb b/spec/controllers/baloon_templates_controller_spec.rb
deleted file mode 100644 (file)
index 34c2897..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-require 'spec_helper'
-
-# This spec was generated by rspec-rails when you ran the scaffold generator.
-# It demonstrates how one might use RSpec to specify the controller code that
-# was generated by Rails when you ran the scaffold generator.
-#
-# It assumes that the implementation code is generated by the rails scaffold
-# generator.  If you are using any extension libraries to generate different
-# controller code, this generated spec may or may not pass.
-#
-# It only uses APIs available in rails and/or rspec-rails.  There are a number
-# of tools you can use to make these specs even more expressive, but we're
-# sticking to rails and rspec-rails APIs to keep things simple and stable.
-#
-# Compared to earlier versions of this generator, there is very limited use of
-# stubs and message expectations in this spec.  Stubs are only used when there
-# is no simpler way to get a handle on the object needed for the example.
-# Message expectations are only used when there is no simpler way to specify
-# that an instance is receiving a specific message.
-
-describe BaloonTemplatesController do
-
-  # This should return the minimal set of attributes required to create a valid
-  # BaloonTemplate. As you add validations to BaloonTemplate, be sure to
-  # update the return value of this method accordingly.
-  def valid_attributes
-    {}
-  end
-
-  describe "GET index" do
-    it "assigns all baloon_templates as @baloon_templates" do
-      baloon_template = BaloonTemplate.create! valid_attributes
-      get :index
-      assigns(:baloon_templates).should eq([baloon_template])
-    end
-  end
-
-  describe "GET show" do
-    it "assigns the requested baloon_template as @baloon_template" do
-      baloon_template = BaloonTemplate.create! valid_attributes
-      get :show, :id => baloon_template.id
-      assigns(:baloon_template).should eq(baloon_template)
-    end
-  end
-
-  describe "GET new" do
-    it "assigns a new baloon_template as @baloon_template" do
-      get :new
-      assigns(:baloon_template).should be_a_new(BaloonTemplate)
-    end
-  end
-
-  describe "GET edit" do
-    it "assigns the requested baloon_template as @baloon_template" do
-      baloon_template = BaloonTemplate.create! valid_attributes
-      get :edit, :id => baloon_template.id
-      assigns(:baloon_template).should eq(baloon_template)
-    end
-  end
-
-  describe "POST create" do
-    describe "with valid params" do
-      it "creates a new BaloonTemplate" do
-        expect {
-          post :create, :baloon_template => valid_attributes
-        }.to change(BaloonTemplate, :count).by(1)
-      end
-
-      it "assigns a newly created baloon_template as @baloon_template" do
-        post :create, :baloon_template => valid_attributes
-        assigns(:baloon_template).should be_a(BaloonTemplate)
-        assigns(:baloon_template).should be_persisted
-      end
-
-      it "redirects to the created baloon_template" do
-        post :create, :baloon_template => valid_attributes
-        response.should redirect_to(BaloonTemplate.last)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns a newly created but unsaved baloon_template as @baloon_template" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        BaloonTemplate.any_instance.stub(:save).and_return(false)
-        post :create, :baloon_template => {}
-        assigns(:baloon_template).should be_a_new(BaloonTemplate)
-      end
-
-      it "re-renders the 'new' template" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        BaloonTemplate.any_instance.stub(:save).and_return(false)
-        post :create, :baloon_template => {}
-        response.should render_template("new")
-      end
-    end
-  end
-
-  describe "PUT update" do
-    describe "with valid params" do
-      it "updates the requested baloon_template" do
-        baloon_template = BaloonTemplate.create! valid_attributes
-        # Assuming there are no other baloon_templates in the database, this
-        # specifies that the BaloonTemplate created on the previous line
-        # receives the :update_attributes message with whatever params are
-        # submitted in the request.
-        BaloonTemplate.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
-        put :update, :id => baloon_template.id, :baloon_template => {'these' => 'params'}
-      end
-
-      it "assigns the requested baloon_template as @baloon_template" do
-        baloon_template = BaloonTemplate.create! valid_attributes
-        put :update, :id => baloon_template.id, :baloon_template => valid_attributes
-        assigns(:baloon_template).should eq(baloon_template)
-      end
-
-      it "redirects to the baloon_template" do
-        baloon_template = BaloonTemplate.create! valid_attributes
-        put :update, :id => baloon_template.id, :baloon_template => valid_attributes
-        response.should redirect_to(baloon_template)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns the baloon_template as @baloon_template" do
-        baloon_template = BaloonTemplate.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        BaloonTemplate.any_instance.stub(:save).and_return(false)
-        put :update, :id => baloon_template.id, :baloon_template => {}
-        assigns(:baloon_template).should eq(baloon_template)
-      end
-
-      it "re-renders the 'edit' template" do
-        baloon_template = BaloonTemplate.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        BaloonTemplate.any_instance.stub(:save).and_return(false)
-        put :update, :id => baloon_template.id, :baloon_template => {}
-        response.should render_template("edit")
-      end
-    end
-  end
-
-  describe "DELETE destroy" do
-    it "destroys the requested baloon_template" do
-      baloon_template = BaloonTemplate.create! valid_attributes
-      expect {
-        delete :destroy, :id => baloon_template.id
-      }.to change(BaloonTemplate, :count).by(-1)
-    end
-
-    it "redirects to the baloon_templates list" do
-      baloon_template = BaloonTemplate.create! valid_attributes
-      delete :destroy, :id => baloon_template.id
-      response.should redirect_to(baloon_templates_url)
-    end
-  end
-
-end
diff --git a/spec/controllers/baloon_types_controller_spec.rb b/spec/controllers/baloon_types_controller_spec.rb
deleted file mode 100644 (file)
index f24963e..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-require 'spec_helper'
-
-# This spec was generated by rspec-rails when you ran the scaffold generator.
-# It demonstrates how one might use RSpec to specify the controller code that
-# was generated by Rails when you ran the scaffold generator.
-#
-# It assumes that the implementation code is generated by the rails scaffold
-# generator.  If you are using any extension libraries to generate different
-# controller code, this generated spec may or may not pass.
-#
-# It only uses APIs available in rails and/or rspec-rails.  There are a number
-# of tools you can use to make these specs even more expressive, but we're
-# sticking to rails and rspec-rails APIs to keep things simple and stable.
-#
-# Compared to earlier versions of this generator, there is very limited use of
-# stubs and message expectations in this spec.  Stubs are only used when there
-# is no simpler way to get a handle on the object needed for the example.
-# Message expectations are only used when there is no simpler way to specify
-# that an instance is receiving a specific message.
-
-describe BaloonTypesController do
-
-  # This should return the minimal set of attributes required to create a valid
-  # BaloonType. As you add validations to BaloonType, be sure to
-  # update the return value of this method accordingly.
-  def valid_attributes
-    {}
-  end
-
-  describe "GET index" do
-    it "assigns all baloon_types as @baloon_types" do
-      baloon_type = BaloonType.create! valid_attributes
-      get :index
-      assigns(:baloon_types).should eq([baloon_type])
-    end
-  end
-
-  describe "GET show" do
-    it "assigns the requested baloon_type as @baloon_type" do
-      baloon_type = BaloonType.create! valid_attributes
-      get :show, :id => baloon_type.id
-      assigns(:baloon_type).should eq(baloon_type)
-    end
-  end
-
-  describe "GET new" do
-    it "assigns a new baloon_type as @baloon_type" do
-      get :new
-      assigns(:baloon_type).should be_a_new(BaloonType)
-    end
-  end
-
-  describe "GET edit" do
-    it "assigns the requested baloon_type as @baloon_type" do
-      baloon_type = BaloonType.create! valid_attributes
-      get :edit, :id => baloon_type.id
-      assigns(:baloon_type).should eq(baloon_type)
-    end
-  end
-
-  describe "POST create" do
-    describe "with valid params" do
-      it "creates a new BaloonType" do
-        expect {
-          post :create, :baloon_type => valid_attributes
-        }.to change(BaloonType, :count).by(1)
-      end
-
-      it "assigns a newly created baloon_type as @baloon_type" do
-        post :create, :baloon_type => valid_attributes
-        assigns(:baloon_type).should be_a(BaloonType)
-        assigns(:baloon_type).should be_persisted
-      end
-
-      it "redirects to the created baloon_type" do
-        post :create, :baloon_type => valid_attributes
-        response.should redirect_to(BaloonType.last)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns a newly created but unsaved baloon_type as @baloon_type" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        BaloonType.any_instance.stub(:save).and_return(false)
-        post :create, :baloon_type => {}
-        assigns(:baloon_type).should be_a_new(BaloonType)
-      end
-
-      it "re-renders the 'new' template" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        BaloonType.any_instance.stub(:save).and_return(false)
-        post :create, :baloon_type => {}
-        response.should render_template("new")
-      end
-    end
-  end
-
-  describe "PUT update" do
-    describe "with valid params" do
-      it "updates the requested baloon_type" do
-        baloon_type = BaloonType.create! valid_attributes
-        # Assuming there are no other baloon_types in the database, this
-        # specifies that the BaloonType created on the previous line
-        # receives the :update_attributes message with whatever params are
-        # submitted in the request.
-        BaloonType.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
-        put :update, :id => baloon_type.id, :baloon_type => {'these' => 'params'}
-      end
-
-      it "assigns the requested baloon_type as @baloon_type" do
-        baloon_type = BaloonType.create! valid_attributes
-        put :update, :id => baloon_type.id, :baloon_type => valid_attributes
-        assigns(:baloon_type).should eq(baloon_type)
-      end
-
-      it "redirects to the baloon_type" do
-        baloon_type = BaloonType.create! valid_attributes
-        put :update, :id => baloon_type.id, :baloon_type => valid_attributes
-        response.should redirect_to(baloon_type)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns the baloon_type as @baloon_type" do
-        baloon_type = BaloonType.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        BaloonType.any_instance.stub(:save).and_return(false)
-        put :update, :id => baloon_type.id, :baloon_type => {}
-        assigns(:baloon_type).should eq(baloon_type)
-      end
-
-      it "re-renders the 'edit' template" do
-        baloon_type = BaloonType.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        BaloonType.any_instance.stub(:save).and_return(false)
-        put :update, :id => baloon_type.id, :baloon_type => {}
-        response.should render_template("edit")
-      end
-    end
-  end
-
-  describe "DELETE destroy" do
-    it "destroys the requested baloon_type" do
-      baloon_type = BaloonType.create! valid_attributes
-      expect {
-        delete :destroy, :id => baloon_type.id
-      }.to change(BaloonType, :count).by(-1)
-    end
-
-    it "redirects to the baloon_types list" do
-      baloon_type = BaloonType.create! valid_attributes
-      delete :destroy, :id => baloon_type.id
-      response.should redirect_to(baloon_types_url)
-    end
-  end
-
-end
diff --git a/spec/controllers/baloons_controller_spec.rb b/spec/controllers/baloons_controller_spec.rb
deleted file mode 100644 (file)
index a8a461f..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-require 'spec_helper'
-
-# This spec was generated by rspec-rails when you ran the scaffold generator.
-# It demonstrates how one might use RSpec to specify the controller code that
-# was generated by Rails when you ran the scaffold generator.
-#
-# It assumes that the implementation code is generated by the rails scaffold
-# generator.  If you are using any extension libraries to generate different
-# controller code, this generated spec may or may not pass.
-#
-# It only uses APIs available in rails and/or rspec-rails.  There are a number
-# of tools you can use to make these specs even more expressive, but we're
-# sticking to rails and rspec-rails APIs to keep things simple and stable.
-#
-# Compared to earlier versions of this generator, there is very limited use of
-# stubs and message expectations in this spec.  Stubs are only used when there
-# is no simpler way to get a handle on the object needed for the example.
-# Message expectations are only used when there is no simpler way to specify
-# that an instance is receiving a specific message.
-
-describe BaloonsController do
-
-  # This should return the minimal set of attributes required to create a valid
-  # Baloon. As you add validations to Baloon, be sure to
-  # update the return value of this method accordingly.
-  def valid_attributes
-    {}
-  end
-
-  describe "GET index" do
-    it "assigns all baloons as @baloons" do
-      baloon = Baloon.create! valid_attributes
-      get :index
-      assigns(:baloons).should eq([baloon])
-    end
-  end
-
-  describe "GET show" do
-    it "assigns the requested baloon as @baloon" do
-      baloon = Baloon.create! valid_attributes
-      get :show, :id => baloon.id
-      assigns(:baloon).should eq(baloon)
-    end
-  end
-
-  describe "GET new" do
-    it "assigns a new baloon as @baloon" do
-      get :new
-      assigns(:baloon).should be_a_new(Baloon)
-    end
-  end
-
-  describe "GET edit" do
-    it "assigns the requested baloon as @baloon" do
-      baloon = Baloon.create! valid_attributes
-      get :edit, :id => baloon.id
-      assigns(:baloon).should eq(baloon)
-    end
-  end
-
-  describe "POST create" do
-    describe "with valid params" do
-      it "creates a new Baloon" do
-        expect {
-          post :create, :baloon => valid_attributes
-        }.to change(Baloon, :count).by(1)
-      end
-
-      it "assigns a newly created baloon as @baloon" do
-        post :create, :baloon => valid_attributes
-        assigns(:baloon).should be_a(Baloon)
-        assigns(:baloon).should be_persisted
-      end
-
-      it "redirects to the created baloon" do
-        post :create, :baloon => valid_attributes
-        response.should redirect_to(Baloon.last)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns a newly created but unsaved baloon as @baloon" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        Baloon.any_instance.stub(:save).and_return(false)
-        post :create, :baloon => {}
-        assigns(:baloon).should be_a_new(Baloon)
-      end
-
-      it "re-renders the 'new' template" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        Baloon.any_instance.stub(:save).and_return(false)
-        post :create, :baloon => {}
-        response.should render_template("new")
-      end
-    end
-  end
-
-  describe "PUT update" do
-    describe "with valid params" do
-      it "updates the requested baloon" do
-        baloon = Baloon.create! valid_attributes
-        # Assuming there are no other baloons in the database, this
-        # specifies that the Baloon created on the previous line
-        # receives the :update_attributes message with whatever params are
-        # submitted in the request.
-        Baloon.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
-        put :update, :id => baloon.id, :baloon => {'these' => 'params'}
-      end
-
-      it "assigns the requested baloon as @baloon" do
-        baloon = Baloon.create! valid_attributes
-        put :update, :id => baloon.id, :baloon => valid_attributes
-        assigns(:baloon).should eq(baloon)
-      end
-
-      it "redirects to the baloon" do
-        baloon = Baloon.create! valid_attributes
-        put :update, :id => baloon.id, :baloon => valid_attributes
-        response.should redirect_to(baloon)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns the baloon as @baloon" do
-        baloon = Baloon.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        Baloon.any_instance.stub(:save).and_return(false)
-        put :update, :id => baloon.id, :baloon => {}
-        assigns(:baloon).should eq(baloon)
-      end
-
-      it "re-renders the 'edit' template" do
-        baloon = Baloon.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        Baloon.any_instance.stub(:save).and_return(false)
-        put :update, :id => baloon.id, :baloon => {}
-        response.should render_template("edit")
-      end
-    end
-  end
-
-  describe "DELETE destroy" do
-    it "destroys the requested baloon" do
-      baloon = Baloon.create! valid_attributes
-      expect {
-        delete :destroy, :id => baloon.id
-      }.to change(Baloon, :count).by(-1)
-    end
-
-    it "redirects to the baloons list" do
-      baloon = Baloon.create! valid_attributes
-      delete :destroy, :id => baloon.id
-      response.should redirect_to(baloons_url)
-    end
-  end
-
-end
index 7d93e76..07156f0 100644 (file)
@@ -4,6 +4,7 @@ require 'spec_helper'
 describe ComicsController do
   before do
     Factory :admin
+    @license = Factory :license
     @user = Factory :user_yas\r
     @author = @user.author    #ユーザ作成時に連動して作成される
   end
@@ -236,19 +237,19 @@ describe ComicsController do
       end
       it '与えられたcountがセットされている' do
         get :play, :id => @comic.id, :count => 18
-        assigns(:count).should eq 18
+        assigns(:panel_count).should eq 18
       end
       it '省略されると@countにデフォルト値が入る' do
         get :play, :id => @comic.id
-        assigns(:count).should eq Comic.default_panel_size\r
+        assigns(:panel_count).should eq Comic.default_panel_size\r
       end
       it '最大を超えると@countにデフォルト最大値が入る' do
         get :play, :id => @comic.id, :count => 1500
-        assigns(:count).should eq Comic.max_panel_size
+        assigns(:panel_count).should eq Comic.max_panel_size
       end
       it '不正な値が入ると@countにデフォルト最大値が入る' do
         get :play, :id => @comic.id, :page_size => 0
-        assigns(:count).should eq Comic.default_panel_size
+        assigns(:panel_count).should eq Comic.default_panel_size
       end
     end
     context 'つつがなく終わるとき' do
index f12c704..ca1249c 100644 (file)
+# -*- encoding: utf-8 -*-
+#ライセンス
 require 'spec_helper'
 
-# This spec was generated by rspec-rails when you ran the scaffold generator.
-# It demonstrates how one might use RSpec to specify the controller code that
-# was generated by Rails when you ran the scaffold generator.
-#
-# It assumes that the implementation code is generated by the rails scaffold
-# generator.  If you are using any extension libraries to generate different
-# controller code, this generated spec may or may not pass.
-#
-# It only uses APIs available in rails and/or rspec-rails.  There are a number
-# of tools you can use to make these specs even more expressive, but we're
-# sticking to rails and rspec-rails APIs to keep things simple and stable.
-#
-# Compared to earlier versions of this generator, there is very limited use of
-# stubs and message expectations in this spec.  Stubs are only used when there
-# is no simpler way to get a handle on the object needed for the example.
-# Message expectations are only used when there is no simpler way to specify
-# that an instance is receiving a specific message.
-
 describe LicensesController do
-
-  # This should return the minimal set of attributes required to create a valid
-  # License. As you add validations to License, be sure to
-  # update the return value of this method accordingly.
-  def valid_attributes
-    {}
-  end
-
-  describe "GET index" do
-    it "assigns all licenses as @licenses" do
-      license = License.create! valid_attributes
-      get :index
-      assigns(:licenses).should eq([license])
-    end
-  end
-
-  describe "GET show" do
-    it "assigns the requested license as @license" do
-      license = License.create! valid_attributes
-      get :show, :id => license.id
-      assigns(:license).should eq(license)
-    end
-  end
-
-  describe "GET new" do
-    it "assigns a new license as @license" do
-      get :new
-      assigns(:license).should be_a_new(License)
-    end
-  end
-
-  describe "GET edit" do
-    it "assigns the requested license as @license" do
-      license = License.create! valid_attributes
-      get :edit, :id => license.id
-      assigns(:license).should eq(license)
-    end
-  end
-
-  describe "POST create" do
-    describe "with valid params" do
-      it "creates a new License" do
-        expect {
-          post :create, :license => valid_attributes
-        }.to change(License, :count).by(1)
-      end
-
-      it "assigns a newly created license as @license" do
-        post :create, :license => valid_attributes
-        assigns(:license).should be_a(License)
-        assigns(:license).should be_persisted
-      end
-
-      it "redirects to the created license" do
-        post :create, :license => valid_attributes
-        response.should redirect_to(License.last)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns a newly created but unsaved license as @license" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        License.any_instance.stub(:save).and_return(false)
-        post :create, :license => {}
-        assigns(:license).should be_a_new(License)
-      end
-
-      it "re-renders the 'new' template" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        License.any_instance.stub(:save).and_return(false)
-        post :create, :license => {}
-        response.should render_template("new")
-      end
-    end
-  end
-
-  describe "PUT update" do
-    describe "with valid params" do
-      it "updates the requested license" do
-        license = License.create! valid_attributes
-        # Assuming there are no other licenses in the database, this
-        # specifies that the License created on the previous line
-        # receives the :update_attributes message with whatever params are
-        # submitted in the request.
-        License.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
-        put :update, :id => license.id, :license => {'these' => 'params'}
-      end
-
-      it "assigns the requested license as @license" do
-        license = License.create! valid_attributes
-        put :update, :id => license.id, :license => valid_attributes
-        assigns(:license).should eq(license)
-      end
-
-      it "redirects to the license" do
-        license = License.create! valid_attributes
-        put :update, :id => license.id, :license => valid_attributes
-        response.should redirect_to(license)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns the license as @license" do
-        license = License.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        License.any_instance.stub(:save).and_return(false)
-        put :update, :id => license.id, :license => {}
-        assigns(:license).should eq(license)
-      end
-
-      it "re-renders the 'edit' template" do
-        license = License.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        License.any_instance.stub(:save).and_return(false)
-        put :update, :id => license.id, :license => {}
-        response.should render_template("edit")
-      end
-    end
+  before do
+    Factory :admin
+    @user = Factory( :user_yas)
+    @author = @user.author
+    @artist = Factory :artist_yas, :author_id => @author.id
   end
 
-  describe "DELETE destroy" do
-    it "destroys the requested license" do
-      license = License.create! valid_attributes
-      expect {
-        delete :destroy, :id => license.id
-      }.to change(License, :count).by(-1)
+  describe 'システム初期化要請に於いて' do
+    before do
+      @op = Factory :original_picture, :artist_id => @artist.id 
+      sign_in @user
+      OriginalPicture.stub(:list).and_return([@op, @op, @op])
     end
-
-    it "redirects to the licenses list" do
-      license = License.create! valid_attributes
-      delete :destroy, :id => license.id
-      response.should redirect_to(licenses_url)
+    context 'パラメータpageについて' do
     end
   end
-
 end
index 819760a..d4eae4b 100644 (file)
@@ -1,32 +1,9 @@
+# -*- encoding: utf-8 -*-
+#オリジナルライセンス
 require 'spec_helper'
 
-# This spec was generated by rspec-rails when you ran the scaffold generator.
-# It demonstrates how one might use RSpec to specify the controller code that
-# was generated by Rails when you ran the scaffold generator.
-#
-# It assumes that the implementation code is generated by the rails scaffold
-# generator.  If you are using any extension libraries to generate different
-# controller code, this generated spec may or may not pass.
-#
-# It only uses APIs available in rails and/or rspec-rails.  There are a number
-# of tools you can use to make these specs even more expressive, but we're
-# sticking to rails and rspec-rails APIs to keep things simple and stable.
-#
-# Compared to earlier versions of this generator, there is very limited use of
-# stubs and message expectations in this spec.  Stubs are only used when there
-# is no simpler way to get a handle on the object needed for the example.
-# Message expectations are only used when there is no simpler way to specify
-# that an instance is receiving a specific message.
-
 describe OriginalLicensesController do
 
-  # This should return the minimal set of attributes required to create a valid
-  # OriginalLicense. As you add validations to OriginalLicense, be sure to
-  # update the return value of this method accordingly.
-  def valid_attributes
-    {}
-  end
-
   describe "GET index" do
     it "assigns all original_licenses as @original_licenses" do
       original_license = OriginalLicense.create! valid_attributes
@@ -34,124 +11,4 @@ describe OriginalLicensesController do
       assigns(:original_licenses).should eq([original_license])
     end
   end
-
-  describe "GET show" do
-    it "assigns the requested original_license as @original_license" do
-      original_license = OriginalLicense.create! valid_attributes
-      get :show, :id => original_license.id
-      assigns(:original_license).should eq(original_license)
-    end
-  end
-
-  describe "GET new" do
-    it "assigns a new original_license as @original_license" do
-      get :new
-      assigns(:original_license).should be_a_new(OriginalLicense)
-    end
-  end
-
-  describe "GET edit" do
-    it "assigns the requested original_license as @original_license" do
-      original_license = OriginalLicense.create! valid_attributes
-      get :edit, :id => original_license.id
-      assigns(:original_license).should eq(original_license)
-    end
-  end
-
-  describe "POST create" do
-    describe "with valid params" do
-      it "creates a new OriginalLicense" do
-        expect {
-          post :create, :original_license => valid_attributes
-        }.to change(OriginalLicense, :count).by(1)
-      end
-
-      it "assigns a newly created original_license as @original_license" do
-        post :create, :original_license => valid_attributes
-        assigns(:original_license).should be_a(OriginalLicense)
-        assigns(:original_license).should be_persisted
-      end
-
-      it "redirects to the created original_license" do
-        post :create, :original_license => valid_attributes
-        response.should redirect_to(OriginalLicense.last)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns a newly created but unsaved original_license as @original_license" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        OriginalLicense.any_instance.stub(:save).and_return(false)
-        post :create, :original_license => {}
-        assigns(:original_license).should be_a_new(OriginalLicense)
-      end
-
-      it "re-renders the 'new' template" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        OriginalLicense.any_instance.stub(:save).and_return(false)
-        post :create, :original_license => {}
-        response.should render_template("new")
-      end
-    end
-  end
-
-  describe "PUT update" do
-    describe "with valid params" do
-      it "updates the requested original_license" do
-        original_license = OriginalLicense.create! valid_attributes
-        # Assuming there are no other original_licenses in the database, this
-        # specifies that the OriginalLicense created on the previous line
-        # receives the :update_attributes message with whatever params are
-        # submitted in the request.
-        OriginalLicense.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
-        put :update, :id => original_license.id, :original_license => {'these' => 'params'}
-      end
-
-      it "assigns the requested original_license as @original_license" do
-        original_license = OriginalLicense.create! valid_attributes
-        put :update, :id => original_license.id, :original_license => valid_attributes
-        assigns(:original_license).should eq(original_license)
-      end
-
-      it "redirects to the original_license" do
-        original_license = OriginalLicense.create! valid_attributes
-        put :update, :id => original_license.id, :original_license => valid_attributes
-        response.should redirect_to(original_license)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns the original_license as @original_license" do
-        original_license = OriginalLicense.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        OriginalLicense.any_instance.stub(:save).and_return(false)
-        put :update, :id => original_license.id, :original_license => {}
-        assigns(:original_license).should eq(original_license)
-      end
-
-      it "re-renders the 'edit' template" do
-        original_license = OriginalLicense.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        OriginalLicense.any_instance.stub(:save).and_return(false)
-        put :update, :id => original_license.id, :original_license => {}
-        response.should render_template("edit")
-      end
-    end
-  end
-
-  describe "DELETE destroy" do
-    it "destroys the requested original_license" do
-      original_license = OriginalLicense.create! valid_attributes
-      expect {
-        delete :destroy, :id => original_license.id
-      }.to change(OriginalLicense, :count).by(-1)
-    end
-
-    it "redirects to the original_licenses list" do
-      original_license = OriginalLicense.create! valid_attributes
-      delete :destroy, :id => original_license.id
-      response.should redirect_to(original_licenses_url)
-    end
-  end
-
 end
diff --git a/spec/controllers/panel_pictures_controller_spec.rb b/spec/controllers/panel_pictures_controller_spec.rb
new file mode 100644 (file)
index 0000000..8665c64
--- /dev/null
@@ -0,0 +1,109 @@
+# -*- encoding: utf-8 -*-
+#コマ絵
+require 'spec_helper'
+
+describe PanelPicturesController do
+  before do
+    Factory :admin
+    @license = Factory :license
+    @user = Factory( :user_yas)
+    @author = @user.author
+    @artist = Factory :artist_yas, :author_id => @author.id
+  end
+
+  describe '一覧表示に於いて' do
+    before do
+      @pp = Factory :panel_picture
+      sign_in @user
+      PanelPicture.stub(:list).and_return([@pp, @pp, @pp])
+    end
+    context 'パラメータpageについて' do
+      it '@pageに値が入る' do
+        get :index, :page => 5
+        assigns(:page).should eq 5
+      end
+      it '省略されると@pageに1値が入る' do
+        get :index
+        assigns(:page).should eq 1
+      end
+      it '与えられたpage_sizeがセットされている' do
+        get :index, :page_size => 15
+        assigns(:page_size).should eq 15
+      end
+      it '省略されると@page_sizeにデフォルト値が入る' do
+        get :index
+        assigns(:page_size).should eq PanelPicture.default_page_size
+      end
+      it '最大を超えると@page_sizeにデフォルト最大値が入る' do
+        get :index, :page_size => 1500
+        assigns(:page_size).should eq PanelPicture.max_page_size
+      end
+      it '不正な値が入ると@page_sizeにデフォルト最大値が入る' do
+        get :index, :page_size => 0
+        assigns(:page_size).should eq PanelPicture.default_page_size
+      end
+    end
+    context 'つつがなく終わるとき' do
+      it 'ステータスコード200 OKを返す' do
+        get :index
+        response.should be_success 
+      end
+      it 'コマ絵モデルに一覧を問い合わせている' do
+        PanelPicture.should_receive(:list).exactly(1)
+        get :index
+      end
+      it '@panel_picturesにリストを取得している' do
+        get :index
+        assigns(:panel_pictures).should have_at_least(3).items
+      end
+      context 'html形式' do
+        it 'indexテンプレートを描画する' do
+          get :index
+          response.should render_template("index")
+        end
+      end
+      context 'json形式' do
+        it 'jsonデータを返す' do
+          get :index, :format => :json
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
+        end
+        it 'データがリスト構造になっている' do
+          get :index, :format => :json
+          json = JSON.parse response.body
+          json.should have_at_least(3).items
+        end
+        it 'リストの先頭くらいはコマ絵っぽいものであって欲しい' do
+          get :index, :format => :json
+          json = JSON.parse response.body
+          json.first.has_key?("link").should be_true
+        end
+      end
+    end
+    context '作家権限がないとき' do
+      before do
+        sign_out @user
+      end
+      context 'html形式' do
+        it 'ステータスコード302 Foundを返す' do
+          get :index
+          response.status.should eq 302
+        end
+        it 'サインインページへ遷移する' do
+          get :index
+          response.should redirect_to '/users/sign_in'
+        end
+      end
+      context 'json形式' do
+        it 'ステータスコード401 Unauthorizedを返す' do
+          get :index, :format => :json
+          response.status.should eq 401
+        end
+        it '応答メッセージにUnauthorizedを返す' do
+          get :index, :format => :json
+          response.message.should match(/Unauthorized/)
+        end
+      end
+    end
+  end
+  
+end
index fcbd3bd..2a2ae43 100644 (file)
 # -*- encoding: utf-8 -*-\r
-require 'spec_helper'
-
-describe PanelsController do
-  before do
-    Factory :admin
+require 'spec_helper'\r
+\r
+describe PanelsController do\r
+  before do\r
+    Factory :admin\r
+    @license = Factory :license
     @user = Factory :user_yas\r
-    @author = @user.author    #ユーザ作成時に連動して作成される
-  end
-  
-  describe '新規作成に於いて' do
-    before do
-      @comic = Factory :normal_comic, :author_id => @user.author.id
-      sign_in @user
-    end
-    context '事前チェックする' do
-      before do
-        controller
-        Panel.stub(:count).and_return(10)
-      end
-      it 'panelがパラメータにあれば、展開する' do
-        post :create, :panel => Factory.attributes_for(:panel, :comic_id => @comic.id)
-        assigns(:prm)['border'].to_i.should eq 1
-      end
-      it 'jsonがパラメータにあれば、展開する' do
-        post :create, :json => Factory.attributes_for(:panel, :comic_id => @comic.id, :border => 4).to_s
-        assigns(:prm)['border'].to_i.should eq 4
-      end
-      it 'panel・json両パラメータがあれば、panelを優先して展開する' do
-        post :create, {
-          :panel => Factory.attributes_for(:panel, :comic_id => @comic.id), 
-          :json => Factory.attributes_for(:panel, :comic_id => @comic.id, :border => 4).to_s
-        }
-        assigns(:prm)['border'].to_i.should eq 1
-      end
-    end
-  end
-
-end
+    @author = @user.author    #ユーザ作成時に連動して作成される\r
+  end\r
+  \r
+  describe '一覧表示に於いて' do\r
+    before do\r
+      @panel = Factory :panel, :author_id => @user.author.id\r
+      Panel.stub(:list).and_return([@panel, @panel, @panel])\r
+      sign_in @user\r
+    end\r
+    context '事前チェックする' do\r
+      it '与えられたpageがセットされている' do\r
+        get :index, :page => 5\r
+        assigns(:page).should eq 5\r
+      end\r
+      it '省略されると@pageに1値が入る' do\r
+        get :index\r
+        assigns(:page).should eq 1\r
+      end\r
+      it '与えられたpage_sizeがセットされている' do\r
+        get :index, :page_size => 15\r
+        assigns(:page_size).should eq 15\r
+      end\r
+      it '省略されると@page_sizeにデフォルト値が入る' do\r
+        get :index\r
+        assigns(:page_size).should eq Panel.default_page_size\r
+      end\r
+      it '最大を超えると@page_sizeにデフォルト最大値が入る' do\r
+        get :index, :page_size => 1500\r
+        assigns(:page_size).should eq Panel.max_page_size\r
+      end\r
+      it '不正な値が入ると@page_sizeにデフォルト最大値が入る' do\r
+        get :index, :page_size => 0\r
+        assigns(:page_size).should eq Panel.default_page_size\r
+      end\r
+    end\r
+    context 'つつがなく終わるとき' do\r
+      it 'ステータスコード200 OKを返す' do\r
+        get :index\r
+        response.should be_success \r
+      end\r
+      it 'コマモデルに一覧を問い合わせている' do\r
+        Panel.should_receive(:list).exactly(1)\r
+        get :index\r
+      end\r
+      it '@panelsにリストを取得している' do\r
+        get :index\r
+        assigns(:panels).should have_at_least(3).items\r
+      end\r
+      context 'html形式' do\r
+        it 'indexテンプレートを描画する' do\r
+          get :index\r
+          response.should render_template("index")\r
+        end\r
+      end\r
+      context 'json形式' do\r
+        it 'jsonデータを返す' do\r
+          get :index, :format => :json\r
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)\r
+        end\r
+        it 'データがリスト構造になっている' do\r
+          get :index, :format => :json\r
+          json = JSON.parse response.body\r
+          json.should have_at_least(3).items\r
+        end\r
+        it 'リストの先頭くらいはコマっぽいものであって欲しい' do\r
+          get :index, :format => :json\r
+          json = JSON.parse response.body\r
+          json.first.has_key?("comic_id").should be_true\r
+        end\r
+      end\r
+    end\r
+    context '作家権限がないとき' do\r
+      before do\r
+        sign_out @user\r
+      end\r
+      context 'html形式' do\r
+        it 'ステータスコード302 Foundを返す' do\r
+          get :index\r
+          response.status.should eq 302\r
+        end\r
+        it 'サインインページへ遷移する' do\r
+          get :index\r
+          response.should redirect_to '/users/sign_in'\r
+        end\r
+      end\r
+      context 'json形式' do\r
+        it 'ステータスコード401 Unauthorizedを返す' do\r
+          get :index, :format => :json\r
+          response.status.should eq 401\r
+        end\r
+        it '応答メッセージにUnauthorizedを返す' do\r
+          get :index, :format => :json\r
+          response.message.should match(/Unauthorized/)\r
+        end\r
+      end\r
+    end\r
+  end\r
+  \r
+  describe '単体表示に於いて' do\r
+    before do\r
+      @panel = Factory :panel, :author_id => @user.author.id\r
+      Panel.stub(:show).and_return(@panel)\r
+      sign_in @user\r
+    end\r
+    context 'つつがなく終わるとき' do\r
+      it 'ステータスコード200 OKを返す' do\r
+        get :show, :id => @panel.id\r
+        response.should be_success\r
+      end\r
+      it 'コマモデルに単体取得を問い合わせている' do\r
+        Panel.should_receive(:show).exactly(1)\r
+        get :show\r
+      end\r
+      it '@panelにアレを取得している' do\r
+        get :show, :id => @panel.id\r
+        assigns(:panel).id.should eq(@panel.id)\r
+      end\r
+      context 'html形式' do\r
+        it 'showテンプレートを描画する' do\r
+          get :show, :id => @panel.id\r
+          response.should render_template("show")\r
+        end\r
+      end\r
+      context 'json形式' do\r
+        it 'jsonデータを返す' do\r
+          get :show, :id => @panel.id, :format => :json\r
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)\r
+        end\r
+        it 'データがアレになっている' do\r
+          get :show, :id => @panel.id, :format => :json\r
+          json = JSON.parse response.body\r
+          json["width"].should match(/438/)\r
+        end\r
+      end\r
+    end\r
+    context '作家権限がないとき' do\r
+      before do\r
+        sign_out @user\r
+      end\r
+      context 'html形式' do\r
+        it 'ステータスコード302 Foundを返す' do\r
+          get :show, :id => @panel.id\r
+          response.status.should eq 302\r
+        end\r
+        it 'サインインページへ遷移する' do\r
+          get :show, :id => @panel.id\r
+          response.body.should redirect_to '/users/sign_in'\r
+        end\r
+      end\r
+      context 'json形式' do\r
+        it 'ステータスコード401 Unauthorizedを返す' do\r
+          get :show, :id => @panel.id, :format => :json\r
+          response.status.should eq 401\r
+        end\r
+        it '応答メッセージにUnauthorizedを返す' do\r
+          get :show, :id => @panel.id, :format => :json\r
+          response.message.should match(/Unauthorized/)\r
+        end\r
+      end\r
+    end\r
+=begin\r
+    context '対象コマがないとき' do\r
+      context 'html形式' do\r
+        it '例外404 not_foundを返す' do\r
+          lambda{\r
+            get :show, :id => 0\r
+          }.should raise_error(ActiveRecord::RecordNotFound)\r
+        end\r
+      end\r
+      context 'json形式' do\r
+        it '例外404 not_foundを返す' do\r
+          lambda{ \r
+            get :show, :id => 0, :format => :json\r
+          }.should raise_error(ActiveRecord::RecordNotFound)\r
+        end\r
+      end\r
+    end\r
+    context '非公開コマを見ようとしたとき' do\r
+      context 'html形式' do\r
+        it '例外403 forbiddenを返す' do\r
+          Panel.any_instance.stub(:visible?).with(any_args()).and_return(false)\r
+          hidden = Factory :hidden_panel, :author_id => @author.id\r
+          lambda{\r
+            get :show, :id => hidden\r
+          }.should raise_error(ActiveRecord::Forbidden)\r
+        end\r
+      end\r
+      context 'json形式' do\r
+        it '例外403 forbiddenを返す' do\r
+          Panel.any_instance.stub(:visible?).with(any_args()).and_return(false)\r
+          hidden = Factory :hidden_panel, :author_id => @author.id\r
+          lambda{\r
+            get :show, :id => hidden, :format => :json\r
+          }.should raise_error(ActiveRecord::Forbidden)\r
+        end\r
+      end\r
+    end\r
+=end\r
+  end\r
+  \r
+  describe 'コマ数取得に於いて' do\r
+    before do\r
+      Panel.should_receive(:visible_count).and_return(3)\r
+#      sign_in @user\r
+    end\r
+    context 'つつがなく終わるとき' do\r
+      it 'ステータスコード200 OKを返す' do\r
+        get :count, :format => :json\r
+        response.should be_success \r
+      end\r
+      context 'json形式' do\r
+        it 'jsonデータを返す' do\r
+          get :count, :format => :json\r
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)\r
+        end\r
+        it 'データがHash構造になっていてコマ数が1である' do\r
+          get :count, :format => :json\r
+          json = JSON.parse response.body\r
+          json["count"].should == 3\r
+        end\r
+      end\r
+    end\r
+  end\r
+  \r
+  describe '新規作成フォーム表示に於いて' do\r
+    before do\r
+      sign_in @user\r
+    end\r
+    context 'つつがなく終わるとき' do\r
+      it 'ステータスコード200 OKを返す' do\r
+        get :new\r
+        response.should be_success \r
+      end\r
+      it '@panelに新規データを用意している' do\r
+        get :new\r
+        assigns(:panel).should be_a_new(Panel)\r
+      end\r
+      it 'コマモデルにデフォルト値補充を依頼している' do\r
+        Panel.any_instance.should_receive(:supply_default).exactly(1)\r
+        get :new\r
+      end\r
+      context 'html形式' do\r
+        it 'newテンプレートを描画する' do\r
+          get :new\r
+          response.should render_template("new")\r
+        end\r
+      end\r
+      context 'js形式' do\r
+        it 'new.jsテンプレートを描画する' do\r
+          get :new, :format => :js\r
+          response.should render_template("new")\r
+        end\r
+      end\r
+    end\r
+    context '作家権限がないとき' do\r
+      before do\r
+        sign_out @user\r
+      end\r
+      context 'html形式' do\r
+        it 'ステータスコード302 Foundを返す' do\r
+          get :new\r
+          response.status.should eq 302\r
+        end\r
+        it 'サインインページへ遷移する' do\r
+          get :new\r
+          response.body.should redirect_to '/users/sign_in'\r
+        end\r
+      end\r
+      context 'js形式' do\r
+        it 'ステータスコード401 Unauthorizedを返す' do\r
+          get :new, :format => :js\r
+          response.status.should eq 401\r
+        end\r
+        it '応答メッセージにUnauthorizedを返す' do\r
+          get :new, :format => :js\r
+          response.message.should match(/Unauthorized/)\r
+        end\r
+      end\r
+    end\r
+  end\r
+  \r
+  describe '新規作成に於いて' do\r
+    before do\r
+      @panel = Factory :normal_panel, :author_id => @user.author.id\r
+      sign_in @user\r
+    end\r
+    context '事前チェックする' do\r
+      before do\r
+        controller\r
+        Panel.stub(:count).and_return(10)\r
+      end\r
+      it 'panelがパラメータにあれば、展開する' do\r
+        post :create, :panel => Factory.attributes_for(:panel, :panel_id => @panel.id)\r
+        assigns(:prm)['border'].to_i.should eq 1\r
+      end\r
+      it 'jsonがパラメータにあれば、展開する' do\r
+        post :create, :json => Factory.attributes_for(:panel, :panel_id => @panel.id, :border => 4).to_s\r
+        assigns(:prm)['border'].to_i.should eq 4\r
+      end\r
+      it 'panel・json両パラメータがあれば、panelを優先して展開する' do\r
+        post :create, {\r
+          :panel => Factory.attributes_for(:panel, :panel_id => @panel.id), \r
+          :json => Factory.attributes_for(:panel, :panel_id => @panel.id, :border => 4).to_s\r
+        }\r
+        assigns(:prm)['border'].to_i.should eq 1\r
+      end\r
+    end\r
+    context 'つつがなく終わるとき' do\r
+      it 'モデルに保存依頼する' do\r
+        Panel.any_instance.should_receive(:save).exactly(1)\r
+        post :create, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+      end\r
+      it "@panelに作成されたコマを保持していて、それがDBにある" do\r
+        post :create, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+        assigns(:panel).should be_a(Panel)\r
+        assigns(:panel).should be_persisted\r
+      end\r
+      context 'html形式' do\r
+        it 'ステータスコード302 Foundを返す' do\r
+          Panel.any_instance.stub(:save).and_return(true)\r
+          post :create, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+          response.status.should eq 302\r
+        end\r
+        it '作成されたコマの表示ページへ遷移する' do\r
+#          Panel.any_instance.stub(:save).and_return(true)\r
+          post :create, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+          response.should redirect_to(Panel.last)\r
+        end\r
+      end\r
+      context 'json形式' do\r
+        it 'ステータスコード200 OKを返す' do\r
+#          Panel.any_instance.stub(:save).and_return(true)\r
+          post :create, :panel => Factory.attributes_for(:panel, :author => @author.id), :format => :json\r
+          response.should be_success \r
+        end\r
+        it '作成されたコマをjsonデータで返す' do\r
+          post :create, :panel => Factory.attributes_for(:panel, :author => @author.id), :format => :json\r
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)\r
+        end\r
+        it 'データがアレになっている' do\r
+          post :create, :panel => Factory.attributes_for(:panel, :author => @author.id), :format => :json\r
+          json = JSON.parse response.body\r
+          json["title"].should match(/normal/)\r
+        end\r
+      end\r
+    end\r
+    context '作家権限がないとき' do\r
+      before do\r
+        sign_out @user\r
+      end\r
+      context 'html形式' do\r
+        it 'ステータスコード302 Foundを返す' do\r
+          post :create, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+          response.status.should eq 302\r
+        end\r
+        it 'サインインページへ遷移する' do\r
+          post :create, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+          response.body.should redirect_to '/users/sign_in'\r
+        end\r
+      end\r
+      context 'json形式' do\r
+        it 'ステータスコード401 Unauthorizedを返す' do\r
+          post :create, :panel => Factory.attributes_for(:panel, :author => @author.id), :format => :json\r
+          response.status.should eq 401\r
+        end\r
+        it '応答メッセージにUnauthorizedを返す' do\r
+          post :create, :panel => Factory.attributes_for(:panel, :author => @author.id), :format => :json\r
+          response.message.should match(/Unauthorized/)\r
+        end\r
+      end\r
+    end\r
+    context '検証、保存に失敗した' do\r
+      before do\r
+        Panel.any_instance.stub(:save).and_return(false)\r
+      end\r
+      it "未保存のコマを保持している" do\r
+        post :create, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+        assigns(:panel).should be_a_new(Panel)\r
+      end\r
+      context 'html形式' do\r
+        it 'ステータスコード200 OKを返す' do\r
+          post :create, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+          response.status.should eq 200\r
+        end\r
+        it '新規ページを描画する' do\r
+          post :create, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+          response.should render_template("new")\r
+        end\r
+      end\r
+      context 'json形式' do\r
+        it 'ステータスコード422 unprocessable_entity を返す' do\r
+          post :create, :panel => Factory.attributes_for(:panel, :author => @author.id), :format => :json\r
+          response.status.should eq 422\r
+        end\r
+        it '応答メッセージUnprocessable Entityを返す' do\r
+          post :create, :panel => Factory.attributes_for(:panel, :author => @author.id), :format => :json\r
+          response.message.should match(/Unprocessable/)\r
+        end\r
+      end\r
+    end\r
+  end\r
+\r
+  describe '編集フォーム表示に於いて' do\r
+    before do\r
+      @panel = Factory :panel, :author_id => @author.id\r
+      sign_in @user\r
+      Panel.stub(:show).and_return(@panel)\r
+    end\r
+    context 'つつがなく終わるとき' do\r
+      it 'ステータスコード200 OKを返す' do\r
+        get :edit, :id => @panel.id\r
+        response.should be_success \r
+      end\r
+      it 'コマモデルに単体取得を問い合わせている' do\r
+        Panel.should_receive(:show).exactly(1)\r
+        get :edit, :id => @panel.id\r
+      end\r
+      it '@panelにデータを用意している' do\r
+        get :edit, :id => @panel.id\r
+        assigns(:panel).should eq @panel\r
+      end\r
+      context 'html形式' do\r
+        it 'editテンプレートを描画する' do\r
+          get :edit, :id => @panel.id\r
+          response.should render_template("edit")\r
+        end\r
+      end\r
+      context 'js形式' do\r
+        it 'edit.jsテンプレートを描画する' do\r
+          get :edit, :id => @panel.id, :format => :js\r
+          response.should render_template("edit")\r
+        end\r
+      end\r
+    end\r
+    context '作家権限がないとき' do\r
+      before do\r
+        sign_out @user\r
+      end\r
+      context 'html形式' do\r
+        it 'ステータスコード302 Foundを返す' do\r
+          get :edit, :id => @panel.id\r
+          response.status.should eq 302\r
+        end\r
+        it 'サインインページへ遷移する' do\r
+          get :edit, :id => @panel.id\r
+          response.body.should redirect_to '/users/sign_in'\r
+        end\r
+      end\r
+      context 'js形式' do\r
+        it 'ステータスコード401 Unauthorizedを返す' do\r
+          get :edit, :id => @panel.id, :format => :js\r
+          response.status.should eq 401\r
+        end\r
+        it '応答メッセージにUnauthorizedを返す' do\r
+          get :edit, :id => @panel.id, :format => :js\r
+          response.message.should match(/Unauthorized/)\r
+        end\r
+      end\r
+    end\r
+  end\r
+\r
+  describe '更新に於いて' do\r
+    before do\r
+      @panel = Factory :panel, :author => @author.id\r
+      sign_in @user\r
+    end\r
+    context '事前チェックしておく' do\r
+      it 'コマモデルに単体取得を問い合わせている' do\r
+        Panel.stub(:show).with(any_args()).and_return @panel\r
+        Panel.should_receive(:show).exactly(1)\r
+        put :update, :id => @panel.id, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+      end\r
+      it 'モデルに更新を依頼する' do\r
+        Panel.any_instance.should_receive(:update_attributes).with(any_args)\r
+        put :update, :id => @panel.id, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+      end\r
+      it '@panelにアレを取得している' do\r
+        put :update, :id => @panel.id, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+        assigns(:panel).id.should eq(@panel.id)\r
+      end\r
+    end\r
+    context 'つつがなく終わるとき' do\r
+      it '更新される' do\r
+        put :update, :id => @panel.id, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+        Panel.find(@panel.id).visible.should eq 0\r
+      end\r
+      context 'html形式' do\r
+        it 'ステータスコード302 Foundを返す' do\r
+          Panel.any_instance.stub(:update_attributes).with(any_args()).and_return(true)\r
+          put :update, :id => @panel.id, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+          response.status.should eq 302\r
+        end\r
+        it '更新されたコマの表示ページへ遷移する' do\r
+          put :update, :id => @panel.id, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+          response.should redirect_to(@panel)\r
+        end\r
+      end\r
+      context 'json形式' do\r
+        it 'ステータスコード200 OKを返す' do\r
+          Panel.any_instance.stub(:update_attributes).with(any_args()).and_return(true)\r
+          put :update, :id => @panel.id, :panel => Factory.attributes_for(:panel, :author => @author.id), :format => :json\r
+          response.should be_success \r
+        end\r
+        it 'ページ本体は特に返さない' do\r
+          Panel.any_instance.stub(:update_attributes).with(any_args()).and_return(true)\r
+          put :update, :id => @panel.id, :panel => Factory.attributes_for(:panel, :author => @author.id), :format => :json\r
+          response.body.should match /./\r
+        end\r
+      end\r
+    end\r
+    context '作家権限がないとき' do\r
+      before do\r
+        sign_out @user\r
+      end\r
+      it 'ステータスコード302 Foundを返す' do\r
+        put :update, :id => @panel.id, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+        response.status.should eq 302\r
+      end\r
+      context 'html形式' do\r
+        it 'サインインページへ遷移する' do\r
+          put :update, :id => @panel.id, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+          response.body.should redirect_to '/users/sign_in'\r
+        end\r
+      end\r
+      context 'json形式' do\r
+        it '応答メッセージにUnauthorizedを返す' do\r
+          put :update, :id => @panel.id, :panel => Factory.attributes_for(:panel, :author => @author.id), :format => :json\r
+          response.message.should match(/Unauthorized/)\r
+        end\r
+      end\r
+    end\r
+    context '検証、保存に失敗したとき' do\r
+      before do\r
+        Panel.any_instance.stub(:update_attributes).and_return(false)\r
+      end\r
+      context 'html形式' do\r
+        it 'ステータスコード200 Okを返す' do\r
+          put :update, :id => @panel.id, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+          response.status.should eq 200\r
+        end\r
+        it '編集ページを描画する' do\r
+          put :update, :id => @panel.id, :panel => Factory.attributes_for(:panel, :author => @author.id)\r
+          response.should render_template("edit")\r
+        end\r
+      end\r
+      context 'json形式' do\r
+        it 'ステータスコード422 unprocessable_entity を返す' do\r
+          Panel.any_instance.stub(:update_attributes).and_return(false)\r
+          put :update, :id => @panel.id, :panel => Factory.attributes_for(:panel, :author => @author.id), :format => :json\r
+          response.status.should eq 422\r
+        end\r
+        it '応答メッセージUnprocessable Entityを返す' do\r
+          put :update, :id => @panel.id, :panel => Factory.attributes_for(:panel, :author => @author.id), :format => :json\r
+          response.message.should match(/Unprocessable/)\r
+        end\r
+      end\r
+    end\r
+  end\r
+  \r
+end\r
diff --git a/spec/controllers/pictures_controller_spec.rb b/spec/controllers/pictures_controller_spec.rb
deleted file mode 100644 (file)
index 76639f4..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-require 'spec_helper'
-
-# This spec was generated by rspec-rails when you ran the scaffold generator.
-# It demonstrates how one might use RSpec to specify the controller code that
-# was generated by Rails when you ran the scaffold generator.
-#
-# It assumes that the implementation code is generated by the rails scaffold
-# generator.  If you are using any extension libraries to generate different
-# controller code, this generated spec may or may not pass.
-#
-# It only uses APIs available in rails and/or rspec-rails.  There are a number
-# of tools you can use to make these specs even more expressive, but we're
-# sticking to rails and rspec-rails APIs to keep things simple and stable.
-#
-# Compared to earlier versions of this generator, there is very limited use of
-# stubs and message expectations in this spec.  Stubs are only used when there
-# is no simpler way to get a handle on the object needed for the example.
-# Message expectations are only used when there is no simpler way to specify
-# that an instance is receiving a specific message.
-
-describe PicturesController do
-
-  # This should return the minimal set of attributes required to create a valid
-  # Picture. As you add validations to Picture, be sure to
-  # update the return value of this method accordingly.
-  def valid_attributes
-    {}
-  end
-
-  describe "GET index" do
-    it "assigns all pictures as @pictures" do
-      picture = Picture.create! valid_attributes
-      get :index
-      assigns(:pictures).should eq([picture])
-    end
-  end
-
-  describe "GET show" do
-    it "assigns the requested picture as @picture" do
-      picture = Picture.create! valid_attributes
-      get :show, :id => picture.id
-      assigns(:picture).should eq(picture)
-    end
-  end
-
-  describe "GET new" do
-    it "assigns a new picture as @picture" do
-      get :new
-      assigns(:picture).should be_a_new(Picture)
-    end
-  end
-
-  describe "GET edit" do
-    it "assigns the requested picture as @picture" do
-      picture = Picture.create! valid_attributes
-      get :edit, :id => picture.id
-      assigns(:picture).should eq(picture)
-    end
-  end
-
-  describe "POST create" do
-    describe "with valid params" do
-      it "creates a new Picture" do
-        expect {
-          post :create, :picture => valid_attributes
-        }.to change(Picture, :count).by(1)
-      end
-
-      it "assigns a newly created picture as @picture" do
-        post :create, :picture => valid_attributes
-        assigns(:picture).should be_a(Picture)
-        assigns(:picture).should be_persisted
-      end
-
-      it "redirects to the created picture" do
-        post :create, :picture => valid_attributes
-        response.should redirect_to(Picture.last)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns a newly created but unsaved picture as @picture" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        Picture.any_instance.stub(:save).and_return(false)
-        post :create, :picture => {}
-        assigns(:picture).should be_a_new(Picture)
-      end
-
-      it "re-renders the 'new' template" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        Picture.any_instance.stub(:save).and_return(false)
-        post :create, :picture => {}
-        response.should render_template("new")
-      end
-    end
-  end
-
-  describe "PUT update" do
-    describe "with valid params" do
-      it "updates the requested picture" do
-        picture = Picture.create! valid_attributes
-        # Assuming there are no other pictures in the database, this
-        # specifies that the Picture created on the previous line
-        # receives the :update_attributes message with whatever params are
-        # submitted in the request.
-        Picture.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
-        put :update, :id => picture.id, :picture => {'these' => 'params'}
-      end
-
-      it "assigns the requested picture as @picture" do
-        picture = Picture.create! valid_attributes
-        put :update, :id => picture.id, :picture => valid_attributes
-        assigns(:picture).should eq(picture)
-      end
-
-      it "redirects to the picture" do
-        picture = Picture.create! valid_attributes
-        put :update, :id => picture.id, :picture => valid_attributes
-        response.should redirect_to(picture)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns the picture as @picture" do
-        picture = Picture.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        Picture.any_instance.stub(:save).and_return(false)
-        put :update, :id => picture.id, :picture => {}
-        assigns(:picture).should eq(picture)
-      end
-
-      it "re-renders the 'edit' template" do
-        picture = Picture.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        Picture.any_instance.stub(:save).and_return(false)
-        put :update, :id => picture.id, :picture => {}
-        response.should render_template("edit")
-      end
-    end
-  end
-
-  describe "DELETE destroy" do
-    it "destroys the requested picture" do
-      picture = Picture.create! valid_attributes
-      expect {
-        delete :destroy, :id => picture.id
-      }.to change(Picture, :count).by(-1)
-    end
-
-    it "redirects to the pictures list" do
-      picture = Picture.create! valid_attributes
-      delete :destroy, :id => picture.id
-      response.should redirect_to(pictures_url)
-    end
-  end
-
-end
diff --git a/spec/controllers/resource_pictures_controller_spec.rb b/spec/controllers/resource_pictures_controller_spec.rb
new file mode 100644 (file)
index 0000000..f8fa0d8
--- /dev/null
@@ -0,0 +1,275 @@
+# -*- encoding: utf-8 -*-
+#素材
+require 'spec_helper'
+
+describe ResourcePicturesController do
+  before do
+    Factory :admin
+    @license = Factory :license
+    @user = Factory( :user_yas)
+    @author = @user.author
+    @artist = Factory :artist_yas, :author_id => @author.id
+    @op = Factory :original_picture, :artist_id => @artist.id , :license_id => @license.id
+  end
+
+  describe '一覧表示に於いて' do
+    before do
+      @rp = Factory :resource_picture, :artist_id => @artist.id , :license_id => @license.id, :original_picture_id => @op.id
+      sign_in @user
+      ResourcePicture.stub(:list).and_return([@rp, @rp, @rp])
+    end
+    context 'パラメータpageについて' do
+      it '@pageに値が入る' do
+        get :index, :page => 5
+        assigns(:page).should eq 5
+      end
+      it '省略されると@pageに1値が入る' do
+        get :index
+        assigns(:page).should eq 1
+      end
+      it '与えられたpage_sizeがセットされている' do
+        get :index, :page_size => 15
+        assigns(:page_size).should eq 15
+      end
+      it '省略されると@page_sizeにデフォルト値が入る' do
+        get :index
+        assigns(:page_size).should eq ResourcePicture.default_page_size
+      end
+      it '最大を超えると@page_sizeにデフォルト最大値が入る' do
+        get :index, :page_size => 1500
+        assigns(:page_size).should eq ResourcePicture.max_page_size
+      end
+      it '不正な値が入ると@page_sizeにデフォルト最大値が入る' do
+        get :index, :page_size => 0
+        assigns(:page_size).should eq ResourcePicture.default_page_size
+      end
+    end
+    context 'つつがなく終わるとき' do
+      it 'ステータスコード200 OKを返す' do
+        get :index
+        response.should be_success 
+      end
+      it '素材モデルに一覧を問い合わせている' do
+        ResourcePicture.should_receive(:list).exactly(1)
+        get :index
+      end
+      it '@resource_picturesにリストを取得している' do
+        get :index
+        assigns(:resource_pictures).should have_at_least(3).items
+      end
+      context 'html形式' do
+        it 'indexテンプレートを描画する' do
+          get :index
+          response.should render_template("index")
+        end
+      end
+      context 'json形式' do
+        it 'jsonデータを返す' do
+          get :index, :format => :json
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
+        end
+        it 'データがリスト構造になっている' do
+          get :index, :format => :json
+          json = JSON.parse response.body
+          json.should have_at_least(3).items
+        end
+        it 'リストの先頭くらいは素材っぽいものであって欲しい' do
+          get :index, :format => :json
+          json = JSON.parse response.body
+          json.first.has_key?("ext").should be_true
+        end
+      end
+    end
+    context '作家権限がないとき' do
+      before do
+        sign_out @user
+      end
+      context 'html形式' do
+        it 'ステータスコード302 Foundを返す' do
+          get :index
+          response.status.should eq 302
+        end
+        it 'サインインページへ遷移する' do
+          get :index
+          response.should redirect_to '/users/sign_in'
+        end
+      end
+      context 'json形式' do
+        it 'ステータスコード401 Unauthorizedを返す' do
+          get :index, :format => :json
+          response.status.should eq 401
+        end
+        it '応答メッセージにUnauthorizedを返す' do
+          get :index, :format => :json
+          response.message.should match(/Unauthorized/)
+        end
+      end
+    end
+  end
+  
+  describe '単体表示に於いて' do
+    before do
+      @pic = Factory :resource_picture, :artist_id => @artist.id , :license_id => @license.id, :original_picture_id => @op.id
+      sign_in @user
+      ResourcePicture.stub(:show).and_return(@pic)
+    end
+    context 'つつがなく終わるとき' do
+      it 'ステータスコード200 OKを返す' do
+        get :show, :id => @pic.id
+        response.should be_success
+      end
+      it '素材モデルに単体取得を問い合わせている' do
+        ResourcePicture.should_receive(:show).exactly(1)
+        get :show
+      end
+      it '@resource_pictureにアレを取得している' do
+        get :show, :id => @pic.id
+        assigns(:resource_picture).id.should eq(@pic.id)
+      end
+      context 'html形式' do
+        it 'showテンプレートを描画する' do
+          get :show, :id => @pic.id
+          response.should render_template("show")
+        end
+      end
+      context 'json形式' do
+        it 'jsonデータを返す' do
+          get :show, :id => @pic.id, :format => :json
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
+        end
+        it 'データがアレになっている' do
+          get :show, :id => @pic.id, :format => :json
+          json = JSON.parse response.body
+          json["ext"].should match(/png/)
+        end
+      end
+      #画像送信では、send_dataにスタブをおいてテストしたいが、ここに噛ませると
+      #renderが働かず、エラーとなってしまう。そこで、素材のファイル取得部分に
+      #スタブをおいてsend_dataがデータを返す体裁でテストする。
+      context 'png形式' do
+        it '画像モデルに画像データを問い合わせる' do
+          ResourcePicture.any_instance.should_receive(:restore).exactly(1)
+          get :show, :id => @pic.id, :format => :png
+        end
+        it '画像を送信する' do
+          ResourcePicture.any_instance.stub(:restore).and_return('aaa')
+          get :show, :id => @pic.id, :format => :png
+          response.body.should eq 'aaa'
+        end
+      end
+      context 'gif形式' do
+        it '画像モデルに画像データを問い合わせる' do
+          ResourcePicture.any_instance.should_receive(:restore).exactly(1)
+          get :show, :id => @pic.id, :format => :gif
+        end
+        it '画像を送信する' do
+          ResourcePicture.any_instance.stub(:restore).and_return('bbb')
+          get :show, :id => @pic.id, :format => :gif
+          response.body.should eq 'bbb'
+        end
+      end
+      context 'jpeg形式' do
+        it '画像モデルに画像データを問い合わせる' do
+          ResourcePicture.any_instance.should_receive(:restore).exactly(1)
+          get :show, :id => @pic.id, :format => :jpeg
+        end
+        it '画像を送信する' do
+          ResourcePicture.any_instance.stub(:restore).and_return('ccc')
+          get :show, :id => @pic.id, :format => :jpeg
+          response.body.should eq 'ccc'
+        end
+      end
+    end
+    context '作家権限がないとき' do
+      before do
+        sign_out @user
+      end
+      context 'html形式' do
+        it 'ステータスコード302 Foundを返す' do
+          get :show, :id => @pic.id
+          response.status.should eq 302
+        end
+        it 'サインインページへ遷移する' do
+          get :show, :id => @pic.id
+          response.body.should redirect_to '/users/sign_in'
+        end
+      end
+      context 'json形式' do
+        it 'ステータスコード401 Unauthorizedを返す' do
+          get :show, :id => @pic.id, :format => :json
+          response.status.should eq 401
+        end
+        it '応答メッセージにUnauthorizedを返す' do
+          get :show, :id => @pic.id, :format => :json
+          response.message.should match(/Unauthorized/)
+        end
+      end
+    end
+=begin
+    context '対象素材がないとき' do
+      before do
+        ResourcePicture.unstub(:show)
+      end
+      context 'html形式' do
+        it '例外404 not_foundを返す' do
+          lambda{
+            get :show, :id => 0
+          }.should raise_error(ActiveRecord::RecordNotFound)
+        end
+      end
+      context 'json形式' do
+        it '例外404 not_foundを返す' do
+          lambda{ 
+            get :show, :id => 0, :format => :json
+          }.should raise_error(ActiveRecord::RecordNotFound)
+        end
+      end
+    end
+    context '他人の素材を見ようとしたとき' do
+      before do
+        ResourcePicture.stub(:show).and_return(@pic)
+        ResourcePicture.any_instance.stub(:own?).with(any_args()).and_return(false)
+      end
+      context 'html形式' do
+        it '例外403 forbiddenを返す' do
+          lambda{
+            get :show, :id => @pic.id
+          }.should raise_error(ActiveRecord::Forbidden)
+        end
+      end
+      context 'json形式' do
+        it '例外403 forbiddenを返す' do
+          lambda{
+            get :show, :id => @pic.id, :format => :json
+          }.should raise_error(ActiveRecord::Forbidden)
+        end
+      end
+    end
+=end
+  end
+
+  describe '素材数取得に於いて' do
+    before do
+      ResourcePicture.should_receive(:visible_count).and_return(3)
+#      sign_in @user
+    end
+    context 'つつがなく終わるとき' do
+      it 'ステータスコード200 OKを返す' do
+        get :count, :format => :json
+        response.should be_success 
+      end
+      context 'json形式' do
+        it 'jsonデータを返す' do
+          get :count, :format => :json
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
+        end
+        it 'データがHash構造になっていてコマ絵数が3である' do
+          get :count, :format => :json
+          json = JSON.parse response.body
+          json["count"].should == 3
+        end
+      end
+    end
+  end
+
+end
diff --git a/spec/controllers/source_pictures_controller_spec.rb b/spec/controllers/source_pictures_controller_spec.rb
deleted file mode 100644 (file)
index 8ee713c..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-require 'spec_helper'
-
-# This spec was generated by rspec-rails when you ran the scaffold generator.
-# It demonstrates how one might use RSpec to specify the controller code that
-# was generated by Rails when you ran the scaffold generator.
-#
-# It assumes that the implementation code is generated by the rails scaffold
-# generator.  If you are using any extension libraries to generate different
-# controller code, this generated spec may or may not pass.
-#
-# It only uses APIs available in rails and/or rspec-rails.  There are a number
-# of tools you can use to make these specs even more expressive, but we're
-# sticking to rails and rspec-rails APIs to keep things simple and stable.
-#
-# Compared to earlier versions of this generator, there is very limited use of
-# stubs and message expectations in this spec.  Stubs are only used when there
-# is no simpler way to get a handle on the object needed for the example.
-# Message expectations are only used when there is no simpler way to specify
-# that an instance is receiving a specific message.
-
-describe SourcePicturesController do
-
-  # This should return the minimal set of attributes required to create a valid
-  # SourcePicture. As you add validations to SourcePicture, be sure to
-  # update the return value of this method accordingly.
-  def valid_attributes
-    {}
-  end
-
-  describe "GET index" do
-    it "assigns all source_pictures as @source_pictures" do
-      source_picture = SourcePicture.create! valid_attributes
-      get :index
-      assigns(:source_pictures).should eq([source_picture])
-    end
-  end
-
-  describe "GET show" do
-    it "assigns the requested source_picture as @source_picture" do
-      source_picture = SourcePicture.create! valid_attributes
-      get :show, :id => source_picture.id
-      assigns(:source_picture).should eq(source_picture)
-    end
-  end
-
-  describe "GET new" do
-    it "assigns a new source_picture as @source_picture" do
-      get :new
-      assigns(:source_picture).should be_a_new(SourcePicture)
-    end
-  end
-
-  describe "GET edit" do
-    it "assigns the requested source_picture as @source_picture" do
-      source_picture = SourcePicture.create! valid_attributes
-      get :edit, :id => source_picture.id
-      assigns(:source_picture).should eq(source_picture)
-    end
-  end
-
-  describe "POST create" do
-    describe "with valid params" do
-      it "creates a new SourcePicture" do
-        expect {
-          post :create, :source_picture => valid_attributes
-        }.to change(SourcePicture, :count).by(1)
-      end
-
-      it "assigns a newly created source_picture as @source_picture" do
-        post :create, :source_picture => valid_attributes
-        assigns(:source_picture).should be_a(SourcePicture)
-        assigns(:source_picture).should be_persisted
-      end
-
-      it "redirects to the created source_picture" do
-        post :create, :source_picture => valid_attributes
-        response.should redirect_to(SourcePicture.last)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns a newly created but unsaved source_picture as @source_picture" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        SourcePicture.any_instance.stub(:save).and_return(false)
-        post :create, :source_picture => {}
-        assigns(:source_picture).should be_a_new(SourcePicture)
-      end
-
-      it "re-renders the 'new' template" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        SourcePicture.any_instance.stub(:save).and_return(false)
-        post :create, :source_picture => {}
-        response.should render_template("new")
-      end
-    end
-  end
-
-  describe "PUT update" do
-    describe "with valid params" do
-      it "updates the requested source_picture" do
-        source_picture = SourcePicture.create! valid_attributes
-        # Assuming there are no other source_pictures in the database, this
-        # specifies that the SourcePicture created on the previous line
-        # receives the :update_attributes message with whatever params are
-        # submitted in the request.
-        SourcePicture.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
-        put :update, :id => source_picture.id, :source_picture => {'these' => 'params'}
-      end
-
-      it "assigns the requested source_picture as @source_picture" do
-        source_picture = SourcePicture.create! valid_attributes
-        put :update, :id => source_picture.id, :source_picture => valid_attributes
-        assigns(:source_picture).should eq(source_picture)
-      end
-
-      it "redirects to the source_picture" do
-        source_picture = SourcePicture.create! valid_attributes
-        put :update, :id => source_picture.id, :source_picture => valid_attributes
-        response.should redirect_to(source_picture)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns the source_picture as @source_picture" do
-        source_picture = SourcePicture.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        SourcePicture.any_instance.stub(:save).and_return(false)
-        put :update, :id => source_picture.id, :source_picture => {}
-        assigns(:source_picture).should eq(source_picture)
-      end
-
-      it "re-renders the 'edit' template" do
-        source_picture = SourcePicture.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        SourcePicture.any_instance.stub(:save).and_return(false)
-        put :update, :id => source_picture.id, :source_picture => {}
-        response.should render_template("edit")
-      end
-    end
-  end
-
-  describe "DELETE destroy" do
-    it "destroys the requested source_picture" do
-      source_picture = SourcePicture.create! valid_attributes
-      expect {
-        delete :destroy, :id => source_picture.id
-      }.to change(SourcePicture, :count).by(-1)
-    end
-
-    it "redirects to the source_pictures list" do
-      source_picture = SourcePicture.create! valid_attributes
-      delete :destroy, :id => source_picture.id
-      response.should redirect_to(source_pictures_url)
-    end
-  end
-
-end
diff --git a/spec/controllers/speach_balloons_controller_spec.rb b/spec/controllers/speach_balloons_controller_spec.rb
new file mode 100644 (file)
index 0000000..613161d
--- /dev/null
@@ -0,0 +1,12 @@
+# -*- encoding: utf-8 -*-
+#フキダシ
+require 'spec_helper'
+describe SpeachBalloonsController do
+  describe "GET index" do
+    it "assigns all speach_baloons as @speach_baloons" do
+      speach_baloon = SpeachBaloon.create! valid_attributes
+      get :index
+      assigns(:speach_baloons).should eq([speach_baloon])
+    end
+  end
+end
diff --git a/spec/controllers/speach_baloons_controller_spec.rb b/spec/controllers/speach_baloons_controller_spec.rb
deleted file mode 100644 (file)
index 6f33792..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-require 'spec_helper'
-
-# This spec was generated by rspec-rails when you ran the scaffold generator.
-# It demonstrates how one might use RSpec to specify the controller code that
-# was generated by Rails when you ran the scaffold generator.
-#
-# It assumes that the implementation code is generated by the rails scaffold
-# generator.  If you are using any extension libraries to generate different
-# controller code, this generated spec may or may not pass.
-#
-# It only uses APIs available in rails and/or rspec-rails.  There are a number
-# of tools you can use to make these specs even more expressive, but we're
-# sticking to rails and rspec-rails APIs to keep things simple and stable.
-#
-# Compared to earlier versions of this generator, there is very limited use of
-# stubs and message expectations in this spec.  Stubs are only used when there
-# is no simpler way to get a handle on the object needed for the example.
-# Message expectations are only used when there is no simpler way to specify
-# that an instance is receiving a specific message.
-
-describe SpeachBaloonsController do
-
-  # This should return the minimal set of attributes required to create a valid
-  # SpeachBaloon. As you add validations to SpeachBaloon, be sure to
-  # update the return value of this method accordingly.
-  def valid_attributes
-    {}
-  end
-
-  describe "GET index" do
-    it "assigns all speach_baloons as @speach_baloons" do
-      speach_baloon = SpeachBaloon.create! valid_attributes
-      get :index
-      assigns(:speach_baloons).should eq([speach_baloon])
-    end
-  end
-
-  describe "GET show" do
-    it "assigns the requested speach_baloon as @speach_baloon" do
-      speach_baloon = SpeachBaloon.create! valid_attributes
-      get :show, :id => speach_baloon.id
-      assigns(:speach_baloon).should eq(speach_baloon)
-    end
-  end
-
-  describe "GET new" do
-    it "assigns a new speach_baloon as @speach_baloon" do
-      get :new
-      assigns(:speach_baloon).should be_a_new(SpeachBaloon)
-    end
-  end
-
-  describe "GET edit" do
-    it "assigns the requested speach_baloon as @speach_baloon" do
-      speach_baloon = SpeachBaloon.create! valid_attributes
-      get :edit, :id => speach_baloon.id
-      assigns(:speach_baloon).should eq(speach_baloon)
-    end
-  end
-
-  describe "POST create" do
-    describe "with valid params" do
-      it "creates a new SpeachBaloon" do
-        expect {
-          post :create, :speach_baloon => valid_attributes
-        }.to change(SpeachBaloon, :count).by(1)
-      end
-
-      it "assigns a newly created speach_baloon as @speach_baloon" do
-        post :create, :speach_baloon => valid_attributes
-        assigns(:speach_baloon).should be_a(SpeachBaloon)
-        assigns(:speach_baloon).should be_persisted
-      end
-
-      it "redirects to the created speach_baloon" do
-        post :create, :speach_baloon => valid_attributes
-        response.should redirect_to(SpeachBaloon.last)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns a newly created but unsaved speach_baloon as @speach_baloon" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        SpeachBaloon.any_instance.stub(:save).and_return(false)
-        post :create, :speach_baloon => {}
-        assigns(:speach_baloon).should be_a_new(SpeachBaloon)
-      end
-
-      it "re-renders the 'new' template" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        SpeachBaloon.any_instance.stub(:save).and_return(false)
-        post :create, :speach_baloon => {}
-        response.should render_template("new")
-      end
-    end
-  end
-
-  describe "PUT update" do
-    describe "with valid params" do
-      it "updates the requested speach_baloon" do
-        speach_baloon = SpeachBaloon.create! valid_attributes
-        # Assuming there are no other speach_baloons in the database, this
-        # specifies that the SpeachBaloon created on the previous line
-        # receives the :update_attributes message with whatever params are
-        # submitted in the request.
-        SpeachBaloon.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
-        put :update, :id => speach_baloon.id, :speach_baloon => {'these' => 'params'}
-      end
-
-      it "assigns the requested speach_baloon as @speach_baloon" do
-        speach_baloon = SpeachBaloon.create! valid_attributes
-        put :update, :id => speach_baloon.id, :speach_baloon => valid_attributes
-        assigns(:speach_baloon).should eq(speach_baloon)
-      end
-
-      it "redirects to the speach_baloon" do
-        speach_baloon = SpeachBaloon.create! valid_attributes
-        put :update, :id => speach_baloon.id, :speach_baloon => valid_attributes
-        response.should redirect_to(speach_baloon)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns the speach_baloon as @speach_baloon" do
-        speach_baloon = SpeachBaloon.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        SpeachBaloon.any_instance.stub(:save).and_return(false)
-        put :update, :id => speach_baloon.id, :speach_baloon => {}
-        assigns(:speach_baloon).should eq(speach_baloon)
-      end
-
-      it "re-renders the 'edit' template" do
-        speach_baloon = SpeachBaloon.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        SpeachBaloon.any_instance.stub(:save).and_return(false)
-        put :update, :id => speach_baloon.id, :speach_baloon => {}
-        response.should render_template("edit")
-      end
-    end
-  end
-
-  describe "DELETE destroy" do
-    it "destroys the requested speach_baloon" do
-      speach_baloon = SpeachBaloon.create! valid_attributes
-      expect {
-        delete :destroy, :id => speach_baloon.id
-      }.to change(SpeachBaloon, :count).by(-1)
-    end
-
-    it "redirects to the speach_baloons list" do
-      speach_baloon = SpeachBaloon.create! valid_attributes
-      delete :destroy, :id => speach_baloon.id
-      response.should redirect_to(speach_baloons_url)
-    end
-  end
-
-end
index a01b04c..bc6d6fc 100644 (file)
@@ -1,32 +1,9 @@
+# -*- encoding: utf-8 -*-
+#セリフテンプレート
 require 'spec_helper'
 
-# This spec was generated by rspec-rails when you ran the scaffold generator.
-# It demonstrates how one might use RSpec to specify the controller code that
-# was generated by Rails when you ran the scaffold generator.
-#
-# It assumes that the implementation code is generated by the rails scaffold
-# generator.  If you are using any extension libraries to generate different
-# controller code, this generated spec may or may not pass.
-#
-# It only uses APIs available in rails and/or rspec-rails.  There are a number
-# of tools you can use to make these specs even more expressive, but we're
-# sticking to rails and rspec-rails APIs to keep things simple and stable.
-#
-# Compared to earlier versions of this generator, there is very limited use of
-# stubs and message expectations in this spec.  Stubs are only used when there
-# is no simpler way to get a handle on the object needed for the example.
-# Message expectations are only used when there is no simpler way to specify
-# that an instance is receiving a specific message.
-
 describe SpeachTemplatesController do
 
-  # This should return the minimal set of attributes required to create a valid
-  # SpeachTemplate. As you add validations to SpeachTemplate, be sure to
-  # update the return value of this method accordingly.
-  def valid_attributes
-    {}
-  end
-
   describe "GET index" do
     it "assigns all speach_templates as @speach_templates" do
       speach_template = SpeachTemplate.create! valid_attributes
@@ -35,123 +12,4 @@ describe SpeachTemplatesController do
     end
   end
 
-  describe "GET show" do
-    it "assigns the requested speach_template as @speach_template" do
-      speach_template = SpeachTemplate.create! valid_attributes
-      get :show, :id => speach_template.id
-      assigns(:speach_template).should eq(speach_template)
-    end
-  end
-
-  describe "GET new" do
-    it "assigns a new speach_template as @speach_template" do
-      get :new
-      assigns(:speach_template).should be_a_new(SpeachTemplate)
-    end
-  end
-
-  describe "GET edit" do
-    it "assigns the requested speach_template as @speach_template" do
-      speach_template = SpeachTemplate.create! valid_attributes
-      get :edit, :id => speach_template.id
-      assigns(:speach_template).should eq(speach_template)
-    end
-  end
-
-  describe "POST create" do
-    describe "with valid params" do
-      it "creates a new SpeachTemplate" do
-        expect {
-          post :create, :speach_template => valid_attributes
-        }.to change(SpeachTemplate, :count).by(1)
-      end
-
-      it "assigns a newly created speach_template as @speach_template" do
-        post :create, :speach_template => valid_attributes
-        assigns(:speach_template).should be_a(SpeachTemplate)
-        assigns(:speach_template).should be_persisted
-      end
-
-      it "redirects to the created speach_template" do
-        post :create, :speach_template => valid_attributes
-        response.should redirect_to(SpeachTemplate.last)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns a newly created but unsaved speach_template as @speach_template" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        SpeachTemplate.any_instance.stub(:save).and_return(false)
-        post :create, :speach_template => {}
-        assigns(:speach_template).should be_a_new(SpeachTemplate)
-      end
-
-      it "re-renders the 'new' template" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        SpeachTemplate.any_instance.stub(:save).and_return(false)
-        post :create, :speach_template => {}
-        response.should render_template("new")
-      end
-    end
-  end
-
-  describe "PUT update" do
-    describe "with valid params" do
-      it "updates the requested speach_template" do
-        speach_template = SpeachTemplate.create! valid_attributes
-        # Assuming there are no other speach_templates in the database, this
-        # specifies that the SpeachTemplate created on the previous line
-        # receives the :update_attributes message with whatever params are
-        # submitted in the request.
-        SpeachTemplate.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
-        put :update, :id => speach_template.id, :speach_template => {'these' => 'params'}
-      end
-
-      it "assigns the requested speach_template as @speach_template" do
-        speach_template = SpeachTemplate.create! valid_attributes
-        put :update, :id => speach_template.id, :speach_template => valid_attributes
-        assigns(:speach_template).should eq(speach_template)
-      end
-
-      it "redirects to the speach_template" do
-        speach_template = SpeachTemplate.create! valid_attributes
-        put :update, :id => speach_template.id, :speach_template => valid_attributes
-        response.should redirect_to(speach_template)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns the speach_template as @speach_template" do
-        speach_template = SpeachTemplate.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        SpeachTemplate.any_instance.stub(:save).and_return(false)
-        put :update, :id => speach_template.id, :speach_template => {}
-        assigns(:speach_template).should eq(speach_template)
-      end
-
-      it "re-renders the 'edit' template" do
-        speach_template = SpeachTemplate.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        SpeachTemplate.any_instance.stub(:save).and_return(false)
-        put :update, :id => speach_template.id, :speach_template => {}
-        response.should render_template("edit")
-      end
-    end
-  end
-
-  describe "DELETE destroy" do
-    it "destroys the requested speach_template" do
-      speach_template = SpeachTemplate.create! valid_attributes
-      expect {
-        delete :destroy, :id => speach_template.id
-      }.to change(SpeachTemplate, :count).by(-1)
-    end
-
-    it "redirects to the speach_templates list" do
-      speach_template = SpeachTemplate.create! valid_attributes
-      delete :destroy, :id => speach_template.id
-      response.should redirect_to(speach_templates_url)
-    end
-  end
-
 end
diff --git a/spec/controllers/speachbaloons_controller_spec.rb b/spec/controllers/speachbaloons_controller_spec.rb
deleted file mode 100644 (file)
index 8ee2c2d..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-require 'spec_helper'
-
-# This spec was generated by rspec-rails when you ran the scaffold generator.
-# It demonstrates how one might use RSpec to specify the controller code that
-# was generated by Rails when you ran the scaffold generator.
-#
-# It assumes that the implementation code is generated by the rails scaffold
-# generator.  If you are using any extension libraries to generate different
-# controller code, this generated spec may or may not pass.
-#
-# It only uses APIs available in rails and/or rspec-rails.  There are a number
-# of tools you can use to make these specs even more expressive, but we're
-# sticking to rails and rspec-rails APIs to keep things simple and stable.
-#
-# Compared to earlier versions of this generator, there is very limited use of
-# stubs and message expectations in this spec.  Stubs are only used when there
-# is no simpler way to get a handle on the object needed for the example.
-# Message expectations are only used when there is no simpler way to specify
-# that an instance is receiving a specific message.
-
-describe SpeachbaloonsController do
-
-  # This should return the minimal set of attributes required to create a valid
-  # Speachbaloon. As you add validations to Speachbaloon, be sure to
-  # update the return value of this method accordingly.
-  def valid_attributes
-    {}
-  end
-
-  describe "GET index" do
-    it "assigns all speachbaloons as @speachbaloons" do
-      speachbaloon = Speachbaloon.create! valid_attributes
-      get :index
-      assigns(:speachbaloons).should eq([speachbaloon])
-    end
-  end
-
-  describe "GET show" do
-    it "assigns the requested speachbaloon as @speachbaloon" do
-      speachbaloon = Speachbaloon.create! valid_attributes
-      get :show, :id => speachbaloon.id
-      assigns(:speachbaloon).should eq(speachbaloon)
-    end
-  end
-
-  describe "GET new" do
-    it "assigns a new speachbaloon as @speachbaloon" do
-      get :new
-      assigns(:speachbaloon).should be_a_new(Speachbaloon)
-    end
-  end
-
-  describe "GET edit" do
-    it "assigns the requested speachbaloon as @speachbaloon" do
-      speachbaloon = Speachbaloon.create! valid_attributes
-      get :edit, :id => speachbaloon.id
-      assigns(:speachbaloon).should eq(speachbaloon)
-    end
-  end
-
-  describe "POST create" do
-    describe "with valid params" do
-      it "creates a new Speachbaloon" do
-        expect {
-          post :create, :speachbaloon => valid_attributes
-        }.to change(Speachbaloon, :count).by(1)
-      end
-
-      it "assigns a newly created speachbaloon as @speachbaloon" do
-        post :create, :speachbaloon => valid_attributes
-        assigns(:speachbaloon).should be_a(Speachbaloon)
-        assigns(:speachbaloon).should be_persisted
-      end
-
-      it "redirects to the created speachbaloon" do
-        post :create, :speachbaloon => valid_attributes
-        response.should redirect_to(Speachbaloon.last)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns a newly created but unsaved speachbaloon as @speachbaloon" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        Speachbaloon.any_instance.stub(:save).and_return(false)
-        post :create, :speachbaloon => {}
-        assigns(:speachbaloon).should be_a_new(Speachbaloon)
-      end
-
-      it "re-renders the 'new' template" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        Speachbaloon.any_instance.stub(:save).and_return(false)
-        post :create, :speachbaloon => {}
-        response.should render_template("new")
-      end
-    end
-  end
-
-  describe "PUT update" do
-    describe "with valid params" do
-      it "updates the requested speachbaloon" do
-        speachbaloon = Speachbaloon.create! valid_attributes
-        # Assuming there are no other speachbaloons in the database, this
-        # specifies that the Speachbaloon created on the previous line
-        # receives the :update_attributes message with whatever params are
-        # submitted in the request.
-        Speachbaloon.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
-        put :update, :id => speachbaloon.id, :speachbaloon => {'these' => 'params'}
-      end
-
-      it "assigns the requested speachbaloon as @speachbaloon" do
-        speachbaloon = Speachbaloon.create! valid_attributes
-        put :update, :id => speachbaloon.id, :speachbaloon => valid_attributes
-        assigns(:speachbaloon).should eq(speachbaloon)
-      end
-
-      it "redirects to the speachbaloon" do
-        speachbaloon = Speachbaloon.create! valid_attributes
-        put :update, :id => speachbaloon.id, :speachbaloon => valid_attributes
-        response.should redirect_to(speachbaloon)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns the speachbaloon as @speachbaloon" do
-        speachbaloon = Speachbaloon.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        Speachbaloon.any_instance.stub(:save).and_return(false)
-        put :update, :id => speachbaloon.id, :speachbaloon => {}
-        assigns(:speachbaloon).should eq(speachbaloon)
-      end
-
-      it "re-renders the 'edit' template" do
-        speachbaloon = Speachbaloon.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        Speachbaloon.any_instance.stub(:save).and_return(false)
-        put :update, :id => speachbaloon.id, :speachbaloon => {}
-        response.should render_template("edit")
-      end
-    end
-  end
-
-  describe "DELETE destroy" do
-    it "destroys the requested speachbaloon" do
-      speachbaloon = Speachbaloon.create! valid_attributes
-      expect {
-        delete :destroy, :id => speachbaloon.id
-      }.to change(Speachbaloon, :count).by(-1)
-    end
-
-    it "redirects to the speachbaloons list" do
-      speachbaloon = Speachbaloon.create! valid_attributes
-      delete :destroy, :id => speachbaloon.id
-      response.should redirect_to(speachbaloons_url)
-    end
-  end
-
-end
index 1bb9b27..2d07acc 100644 (file)
@@ -1,32 +1,9 @@
+# -*- encoding: utf-8 -*-
+#セリフ
 require 'spec_helper'
 
-# This spec was generated by rspec-rails when you ran the scaffold generator.
-# It demonstrates how one might use RSpec to specify the controller code that
-# was generated by Rails when you ran the scaffold generator.
-#
-# It assumes that the implementation code is generated by the rails scaffold
-# generator.  If you are using any extension libraries to generate different
-# controller code, this generated spec may or may not pass.
-#
-# It only uses APIs available in rails and/or rspec-rails.  There are a number
-# of tools you can use to make these specs even more expressive, but we're
-# sticking to rails and rspec-rails APIs to keep things simple and stable.
-#
-# Compared to earlier versions of this generator, there is very limited use of
-# stubs and message expectations in this spec.  Stubs are only used when there
-# is no simpler way to get a handle on the object needed for the example.
-# Message expectations are only used when there is no simpler way to specify
-# that an instance is receiving a specific message.
-
 describe SpeachesController do
 
-  # This should return the minimal set of attributes required to create a valid
-  # Speach. As you add validations to Speach, be sure to
-  # update the return value of this method accordingly.
-  def valid_attributes
-    {}
-  end
-
   describe "GET index" do
     it "assigns all speaches as @speaches" do
       speach = Speach.create! valid_attributes
@@ -34,124 +11,4 @@ describe SpeachesController do
       assigns(:speaches).should eq([speach])
     end
   end
-
-  describe "GET show" do
-    it "assigns the requested speach as @speach" do
-      speach = Speach.create! valid_attributes
-      get :show, :id => speach.id
-      assigns(:speach).should eq(speach)
-    end
-  end
-
-  describe "GET new" do
-    it "assigns a new speach as @speach" do
-      get :new
-      assigns(:speach).should be_a_new(Speach)
-    end
-  end
-
-  describe "GET edit" do
-    it "assigns the requested speach as @speach" do
-      speach = Speach.create! valid_attributes
-      get :edit, :id => speach.id
-      assigns(:speach).should eq(speach)
-    end
-  end
-
-  describe "POST create" do
-    describe "with valid params" do
-      it "creates a new Speach" do
-        expect {
-          post :create, :speach => valid_attributes
-        }.to change(Speach, :count).by(1)
-      end
-
-      it "assigns a newly created speach as @speach" do
-        post :create, :speach => valid_attributes
-        assigns(:speach).should be_a(Speach)
-        assigns(:speach).should be_persisted
-      end
-
-      it "redirects to the created speach" do
-        post :create, :speach => valid_attributes
-        response.should redirect_to(Speach.last)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns a newly created but unsaved speach as @speach" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        Speach.any_instance.stub(:save).and_return(false)
-        post :create, :speach => {}
-        assigns(:speach).should be_a_new(Speach)
-      end
-
-      it "re-renders the 'new' template" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        Speach.any_instance.stub(:save).and_return(false)
-        post :create, :speach => {}
-        response.should render_template("new")
-      end
-    end
-  end
-
-  describe "PUT update" do
-    describe "with valid params" do
-      it "updates the requested speach" do
-        speach = Speach.create! valid_attributes
-        # Assuming there are no other speaches in the database, this
-        # specifies that the Speach created on the previous line
-        # receives the :update_attributes message with whatever params are
-        # submitted in the request.
-        Speach.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
-        put :update, :id => speach.id, :speach => {'these' => 'params'}
-      end
-
-      it "assigns the requested speach as @speach" do
-        speach = Speach.create! valid_attributes
-        put :update, :id => speach.id, :speach => valid_attributes
-        assigns(:speach).should eq(speach)
-      end
-
-      it "redirects to the speach" do
-        speach = Speach.create! valid_attributes
-        put :update, :id => speach.id, :speach => valid_attributes
-        response.should redirect_to(speach)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns the speach as @speach" do
-        speach = Speach.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        Speach.any_instance.stub(:save).and_return(false)
-        put :update, :id => speach.id, :speach => {}
-        assigns(:speach).should eq(speach)
-      end
-
-      it "re-renders the 'edit' template" do
-        speach = Speach.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        Speach.any_instance.stub(:save).and_return(false)
-        put :update, :id => speach.id, :speach => {}
-        response.should render_template("edit")
-      end
-    end
-  end
-
-  describe "DELETE destroy" do
-    it "destroys the requested speach" do
-      speach = Speach.create! valid_attributes
-      expect {
-        delete :destroy, :id => speach.id
-      }.to change(Speach, :count).by(-1)
-    end
-
-    it "redirects to the speaches list" do
-      speach = Speach.create! valid_attributes
-      delete :destroy, :id => speach.id
-      response.should redirect_to(speaches_url)
-    end
-  end
-
 end
index 383f24d..f5b6784 100644 (file)
@@ -1,32 +1,8 @@
+# -*- encoding: utf-8 -*-
+#システム画像
 require 'spec_helper'
 
-# This spec was generated by rspec-rails when you ran the scaffold generator.
-# It demonstrates how one might use RSpec to specify the controller code that
-# was generated by Rails when you ran the scaffold generator.
-#
-# It assumes that the implementation code is generated by the rails scaffold
-# generator.  If you are using any extension libraries to generate different
-# controller code, this generated spec may or may not pass.
-#
-# It only uses APIs available in rails and/or rspec-rails.  There are a number
-# of tools you can use to make these specs even more expressive, but we're
-# sticking to rails and rspec-rails APIs to keep things simple and stable.
-#
-# Compared to earlier versions of this generator, there is very limited use of
-# stubs and message expectations in this spec.  Stubs are only used when there
-# is no simpler way to get a handle on the object needed for the example.
-# Message expectations are only used when there is no simpler way to specify
-# that an instance is receiving a specific message.
-
 describe SystemPicturesController do
-
-  # This should return the minimal set of attributes required to create a valid
-  # SystemPicture. As you add validations to SystemPicture, be sure to
-  # update the return value of this method accordingly.
-  def valid_attributes
-    {}
-  end
-
   describe "GET index" do
     it "assigns all system_pictures as @system_pictures" do
       system_picture = SystemPicture.create! valid_attributes
@@ -34,124 +10,4 @@ describe SystemPicturesController do
       assigns(:system_pictures).should eq([system_picture])
     end
   end
-
-  describe "GET show" do
-    it "assigns the requested system_picture as @system_picture" do
-      system_picture = SystemPicture.create! valid_attributes
-      get :show, :id => system_picture.id
-      assigns(:system_picture).should eq(system_picture)
-    end
-  end
-
-  describe "GET new" do
-    it "assigns a new system_picture as @system_picture" do
-      get :new
-      assigns(:system_picture).should be_a_new(SystemPicture)
-    end
-  end
-
-  describe "GET edit" do
-    it "assigns the requested system_picture as @system_picture" do
-      system_picture = SystemPicture.create! valid_attributes
-      get :edit, :id => system_picture.id
-      assigns(:system_picture).should eq(system_picture)
-    end
-  end
-
-  describe "POST create" do
-    describe "with valid params" do
-      it "creates a new SystemPicture" do
-        expect {
-          post :create, :system_picture => valid_attributes
-        }.to change(SystemPicture, :count).by(1)
-      end
-
-      it "assigns a newly created system_picture as @system_picture" do
-        post :create, :system_picture => valid_attributes
-        assigns(:system_picture).should be_a(SystemPicture)
-        assigns(:system_picture).should be_persisted
-      end
-
-      it "redirects to the created system_picture" do
-        post :create, :system_picture => valid_attributes
-        response.should redirect_to(SystemPicture.last)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns a newly created but unsaved system_picture as @system_picture" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        SystemPicture.any_instance.stub(:save).and_return(false)
-        post :create, :system_picture => {}
-        assigns(:system_picture).should be_a_new(SystemPicture)
-      end
-
-      it "re-renders the 'new' template" do
-        # Trigger the behavior that occurs when invalid params are submitted
-        SystemPicture.any_instance.stub(:save).and_return(false)
-        post :create, :system_picture => {}
-        response.should render_template("new")
-      end
-    end
-  end
-
-  describe "PUT update" do
-    describe "with valid params" do
-      it "updates the requested system_picture" do
-        system_picture = SystemPicture.create! valid_attributes
-        # Assuming there are no other system_pictures in the database, this
-        # specifies that the SystemPicture created on the previous line
-        # receives the :update_attributes message with whatever params are
-        # submitted in the request.
-        SystemPicture.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
-        put :update, :id => system_picture.id, :system_picture => {'these' => 'params'}
-      end
-
-      it "assigns the requested system_picture as @system_picture" do
-        system_picture = SystemPicture.create! valid_attributes
-        put :update, :id => system_picture.id, :system_picture => valid_attributes
-        assigns(:system_picture).should eq(system_picture)
-      end
-
-      it "redirects to the system_picture" do
-        system_picture = SystemPicture.create! valid_attributes
-        put :update, :id => system_picture.id, :system_picture => valid_attributes
-        response.should redirect_to(system_picture)
-      end
-    end
-
-    describe "with invalid params" do
-      it "assigns the system_picture as @system_picture" do
-        system_picture = SystemPicture.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        SystemPicture.any_instance.stub(:save).and_return(false)
-        put :update, :id => system_picture.id, :system_picture => {}
-        assigns(:system_picture).should eq(system_picture)
-      end
-
-      it "re-renders the 'edit' template" do
-        system_picture = SystemPicture.create! valid_attributes
-        # Trigger the behavior that occurs when invalid params are submitted
-        SystemPicture.any_instance.stub(:save).and_return(false)
-        put :update, :id => system_picture.id, :system_picture => {}
-        response.should render_template("edit")
-      end
-    end
-  end
-
-  describe "DELETE destroy" do
-    it "destroys the requested system_picture" do
-      system_picture = SystemPicture.create! valid_attributes
-      expect {
-        delete :destroy, :id => system_picture.id
-      }.to change(SystemPicture, :count).by(-1)
-    end
-
-    it "redirects to the system_pictures list" do
-      system_picture = SystemPicture.create! valid_attributes
-      delete :destroy, :id => system_picture.id
-      response.should redirect_to(system_pictures_url)
-    end
-  end
-
 end
diff --git a/spec/controllers/users/sessions_controller_spec.rb b/spec/controllers/users/sessions_controller_spec.rb
new file mode 100644 (file)
index 0000000..51f5efc
--- /dev/null
@@ -0,0 +1,2 @@
+require 'spec_helper'
+
index e868120..489f50d 100644 (file)
@@ -11,6 +11,11 @@ Factory.define :user_yas, :class => User do |user|
 #  user.author Factory(:author_yas)
 end
 
+Factory.define :author, :class => Author do |author|
+  author.name nil
+  author.sequence(:user_id) { |n| n}
+end
+
 Factory.define :author_yas, :class => Author do |author|
   author.name 'yassan'
   author.sequence(:user_id) { |n| n}
@@ -18,6 +23,12 @@ Factory.define :author_yas, :class => Author do |author|
 #  author.artist Factory(:artist_yas)
 end
 
+Factory.define :artist, :class => Artist do |artist|
+  artist.sequence(:email) { |n| "hoge#{n}@gmail.com"}
+  artist.name 'art'
+#  artist.association :author_yas
+end
+
 Factory.define :artist_yas, :class => Artist do |artist|
   artist.sequence(:email) { |n| "hoge#{n}@gmail.com"}
   artist.name 'yas'
index 0815142..fc685c0 100644 (file)
@@ -10,6 +10,3 @@ require 'spec_helper'
 #     end
 #   end
 # end
-describe Admins::SessionsHelper do
-  pending "add some examples to (or delete) #{__FILE__}"
-end
diff --git a/spec/helpers/author_registrations_helper_spec.rb b/spec/helpers/author_registrations_helper_spec.rb
deleted file mode 100644 (file)
index ceaabcb..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-# Specs in this file have access to a helper object that includes
-# the AuthorRegistrationsHelper. For example:
-#
-# describe AuthorRegistrationsHelper do
-#   describe "string concat" do
-#     it "concats two strings with spaces" do
-#       helper.concat_strings("this","that").should == "this that"
-#     end
-#   end
-# end
-describe AuthorRegistrationsHelper do
-  pending "add some examples to (or delete) #{__FILE__}"
-end
similarity index 91%
rename from spec/helpers/baloon_templates_helper_spec.rb
rename to spec/helpers/balloon_templates_helper_spec.rb
index c5576f1..4e6973e 100644 (file)
@@ -10,6 +10,6 @@ require 'spec_helper'
 #     end
 #   end
 # end
-describe BaloonTemplatesHelper do
+describe BalloonTemplatesHelper do
   pending "add some examples to (or delete) #{__FILE__}"
 end
similarity index 93%
rename from spec/helpers/baloons_helper_spec.rb
rename to spec/helpers/balloons_helper_spec.rb
index f693f74..c8b6605 100644 (file)
@@ -10,6 +10,6 @@ require 'spec_helper'
 #     end
 #   end
 # end
-describe BaloonsHelper do
+describe BalloonsHelper do
   pending "add some examples to (or delete) #{__FILE__}"
 end
diff --git a/spec/helpers/baloon_types_helper_spec.rb b/spec/helpers/baloon_types_helper_spec.rb
deleted file mode 100644 (file)
index 835a5e2..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-# Specs in this file have access to a helper object that includes
-# the BaloonTypesHelper. For example:
-#
-# describe BaloonTypesHelper do
-#   describe "string concat" do
-#     it "concats two strings with spaces" do
-#       helper.concat_strings("this","that").should == "this that"
-#     end
-#   end
-# end
-describe BaloonTypesHelper do
-  pending "add some examples to (or delete) #{__FILE__}"
-end
similarity index 92%
rename from spec/helpers/pictures_helper_spec.rb
rename to spec/helpers/panel_pictures_helper_spec.rb
index d0a47d3..fb0c201 100644 (file)
@@ -10,6 +10,6 @@ require 'spec_helper'
 #     end
 #   end
 # end
-describe PicturesHelper do
+describe PanelPicturesHelper do
   pending "add some examples to (or delete) #{__FILE__}"
 end
similarity index 91%
rename from spec/helpers/source_pictures_helper_spec.rb
rename to spec/helpers/resource_pictures_helper_spec.rb
index 5e0a5a5..1da5508 100644 (file)
@@ -10,6 +10,6 @@ require 'spec_helper'
 #     end
 #   end
 # end
-describe SourcePicturesHelper do
+describe ResourcePicturesHelper do
   pending "add some examples to (or delete) #{__FILE__}"
 end
similarity index 92%
rename from spec/helpers/speach_baloons_helper_spec.rb
rename to spec/helpers/speach_balloons_helper_spec.rb
index e68fc3f..14766e1 100644 (file)
@@ -10,6 +10,6 @@ require 'spec_helper'
 #     end
 #   end
 # end
-describe SpeachBaloonsHelper do
+describe SpeachBalloonsHelper do
   pending "add some examples to (or delete) #{__FILE__}"
 end
diff --git a/spec/helpers/speachbaloons_helper_spec.rb b/spec/helpers/speachbaloons_helper_spec.rb
deleted file mode 100644 (file)
index 2fab07c..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-# Specs in this file have access to a helper object that includes
-# the SpeachbaloonsHelper. For example:
-#
-# describe SpeachbaloonsHelper do
-#   describe "string concat" do
-#     it "concats two strings with spaces" do
-#       helper.concat_strings("this","that").should == "this that"
-#     end
-#   end
-# end
-describe SpeachbaloonsHelper do
-  pending "add some examples to (or delete) #{__FILE__}"
-end
similarity index 77%
rename from spec/helpers/authors/sessions_helper_spec.rb
rename to spec/helpers/users/sessions_helper_spec.rb
index ddb409e..38c3315 100644 (file)
@@ -10,6 +10,3 @@ require 'spec_helper'
 #     end
 #   end
 # end
-describe Authors::SessionsHelper do
-  pending "add some examples to (or delete) #{__FILE__}"
-end
index 4efbc73..a3a167f 100644 (file)
@@ -1,5 +1,128 @@
+# -*- encoding: utf-8 -*-
+#絵師
 require 'spec_helper'
 
 describe Artist do
-  pending "add some examples to (or delete) #{__FILE__}"
+  before do
+    Factory :admin
+    @user = Factory( :user_yas)
+    @author = @user.author
+    @license = Factory :license
+  end
+
+  describe '検証に於いて' do
+    before do
+    end
+    
+    it 'オーソドックスなデータなら通る' do
+      @artist = Factory.build :artist, :author_id => @author.id, :default_license_id => @license.id
+      @artist.should be_valid
+    end
+    
+    context 'nameを検証するとき' do
+      it 'nullなら失敗する' do
+        @artist = Factory.build :artist, :author_id => @author.id, :default_license_id => @license.id, :name => nil
+        @artist.should_not be_valid
+      end
+      it '30文字以上なら失敗する' do
+        @artist = Factory.build :artist, :author_id => @author.id, :default_license_id => @license.id, :name => 'a'*31
+        @artist.should_not be_valid
+      end
+    end
+  end
+  
+  describe '自動補充に於いて' do
+    it '名前がno nameになっている' do
+      @artist = Factory.build :artist, :name => nil
+      @artist.save
+      @artist.name.should eq 'no name'
+    end
+  end
+  
+  describe '単体取得に於いて' do
+    before do
+      @artist = Factory :artist, :author_id => @author.id, :default_license_id => @license.id
+    end
+    it '指定の絵師を返す' do
+      a = Artist.show @artist.id
+      a.should eq @artist
+    end
+    context '関連テーブルオプションがないとき' do
+      it '作家データだけを含んでいる' do
+        r = Artist.show_include_opt
+        r.should eq [:author]
+      end
+    end
+    context '関連テーブルオプションで素材を含ませたとき' do
+      it '作家データと素材データを含んでいる' do
+        r = Artist.show_include_opt(:include => :resource_pictures)
+        r.should eq [:author, :resource_pictures]
+      end
+    end
+  end
+  describe '一覧取得に於いて' do
+    before do
+      @artist = Factory :artist, :author_id => @author.id, :default_license_id => @license.id
+    end
+    context 'page補正について' do
+      it '文字列から数値に変換される' do
+        Artist.page('8').should eq 8
+      end
+      it 'nilの場合は1になる' do
+        Artist.page().should eq 1
+      end
+      it '0以下の場合は1になる' do
+        Artist.page('0').should eq 1
+      end
+    end
+    context 'page_size補正について' do
+      it '文字列から数値に変換される' do
+        Artist.page_size('7').should eq 7
+      end
+      it 'nilの場合はArtist.default_page_sizeになる' do
+        Artist.page_size().should eq Artist.default_page_size
+      end
+      it '0以下の場合はArtist.default_page_sizeになる' do
+        Artist.page_size('0').should eq Artist.default_page_size
+      end
+      it 'Artist.max_page_sizeを超えた場合はArtist.max_page_sizeになる' do
+        Artist.page_size('1000').should eq Artist.max_page_size
+      end
+    end
+    it 'リストを返す' do
+      c = Artist.list
+      c.should eq [@artist]
+    end
+    it '時系列で並んでいる' do
+      n = Factory :artist, :author_id => @author.id, :name => 'artist'
+      l = Artist.list
+      l.should eq [n, @artist]
+    end
+    context 'DBに5件あって1ページの件数を2件に変えたとして' do
+      before do
+        @artist2 = Factory :artist, :author_id => @author.id, :name => 'artist2'
+        @artist3 = Factory :artist, :author_id => @author.id, :name => 'artist3'
+        @artist4 = Factory :artist, :author_id => @author.id, :name => 'artist4'
+        @artist5 = Factory :artist, :author_id => @author.id, :name => 'artist5'
+        Artist.stub(:default_page_size).and_return(2)
+      end
+      it '通常は2件を返す' do
+        c = Artist.list
+        c.should have(2).items 
+      end
+      it 'page=1なら末尾2件を返す' do
+        #時系列で並んでいる
+        c = Artist.list({}, 1)
+        c.should eq [@artist5, @artist4]
+      end
+      it 'page=2なら中間2件を返す' do
+        c = Artist.list({}, 2)
+        c.should eq [@artist3, @artist2]
+      end
+      it 'page=3なら先頭1件を返す' do
+        c = Artist.list({}, 3)
+        c.should eq [@artist]
+      end
+    end
+  end
 end
index 0a1954f..3bf3b45 100644 (file)
@@ -1,5 +1,35 @@
+# -*- encoding: utf-8 -*-
+#作家
 require 'spec_helper'
 
 describe Author do
-  pending "add some examples to (or delete) #{__FILE__}"
+  before do
+    Factory :admin
+    @user = Factory( :user_yas)
+    @author = @user.author
+  end
+
+  describe '自動補充に於いて' do
+    #作家はユーザ作成で自動作成されちゃってる
+    it '名前がno nameになっている' do
+      @author.name.should eq 'no name'
+    end
+  end
+  
+  describe '絵師作家判定に於いて' do
+    before do
+    end
+    context 'Trueのケース' do
+      it 'リンクされた絵師がある' do
+        artist = Factory :artist, :author_id => @author.id
+        @author.artist?.should eq true
+      end
+    end
+    context 'Falseのケース' do
+      it 'リンクされた絵師がない' do
+        @author.artist?.should eq false
+      end
+    end
+  end
+  
 end
similarity index 80%
rename from spec/models/picture_spec.rb
rename to spec/models/balloon_spec.rb
index 5ef8eea..a9c7e3b 100644 (file)
@@ -1,5 +1,5 @@
 require 'spec_helper'
 
-describe Picture do
+describe Balloon do
   pending "add some examples to (or delete) #{__FILE__}"
 end
similarity index 75%
rename from spec/models/baloon_template_spec.rb
rename to spec/models/balloon_template_spec.rb
index 2cdb490..7597de5 100644 (file)
@@ -1,5 +1,5 @@
 require 'spec_helper'
 
-describe BaloonTemplate do
+describe BalloonTemplate do
   pending "add some examples to (or delete) #{__FILE__}"
 end
diff --git a/spec/models/baloon_type_spec.rb b/spec/models/baloon_type_spec.rb
deleted file mode 100644 (file)
index 94ab96c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-require 'spec_helper'
-
-describe BaloonType do
-  pending "add some examples to (or delete) #{__FILE__}"
-end
index fbe7cd7..4deb967 100644 (file)
@@ -5,47 +5,5 @@ describe PanelPicture do
   describe '検証に於いて' do
     before do
     end
-    
-    it 'オーソドックスなデータなら通る' do
-      @comic = Factory.build :normal_comic, :author_id => @author.id
-      @comic.should be_valid
-    end
-    
-    context 'widthを検証するとき' do
-      it 'nullなら失敗する' do
-        @comic = Factory.build :normal_comic, :author_id => @author.id, :width => nil
-        @comic.should_not be_valid
-      end
-      it '0なら失敗する' do
-        @comic = Factory.build :normal_comic, :author_id => @author.id, :width => 0
-        @comic.should_not be_valid
-      end
-      it '負では通る' do
-        @comic = Factory.build :normal_comic, :author_id => @author.id, :width => -1
-        @comic.should be_valid
-      end
-      it '正なら通る' do
-        @comic = Factory.build :normal_comic, :author_id => @author.id, :width => 1
-        @comic.should be_valid
-      end
-    end
-    context 'heightを検証するとき' do
-      it 'nullなら失敗する' do
-        @comic = Factory.build :normal_comic, :author_id => @author.id, :height => nil
-        @comic.should_not be_valid
-      end
-      it '0なら失敗する' do
-        @comic = Factory.build :normal_comic, :author_id => @author.id, :height => 0
-        @comic.should_not be_valid
-      end
-      it '負では通る' do
-        @comic = Factory.build :normal_comic, :author_id => @author.id, :height => -1
-        @comic.should be_valid
-      end
-      it '正なら通る' do
-        @comic = Factory.build :normal_comic, :author_id => @author.id, :height => 1
-        @comic.should be_valid
-      end
-    end
   end
 end
similarity index 76%
rename from spec/models/baloon_spec.rb
rename to spec/models/speach_balloon_spec.rb
index 9f91cd0..b8a9b9a 100644 (file)
@@ -1,5 +1,5 @@
 require 'spec_helper'
 
-describe Baloon do
+describe SpeachBalloon do
   pending "add some examples to (or delete) #{__FILE__}"
 end
diff --git a/spec/models/speach_baloon_spec.rb b/spec/models/speach_baloon_spec.rb
deleted file mode 100644 (file)
index 45ac534..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-require 'spec_helper'
-
-describe SpeachBaloon do
-  pending "add some examples to (or delete) #{__FILE__}"
-end
diff --git a/spec/models/speachbaloon_spec.rb b/spec/models/speachbaloon_spec.rb
deleted file mode 100644 (file)
index 77f2e13..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-require 'spec_helper'
-
-describe Speachbaloon do
-  pending "add some examples to (or delete) #{__FILE__}"
-end
index 44032b4..2e488f4 100644 (file)
@@ -1,5 +1,54 @@
+# -*- encoding: utf-8 -*-
+#ユーザアカウント
 require 'spec_helper'
 
 describe User do
-  pending "add some examples to (or delete) #{__FILE__}"
+  before do
+    Factory :admin
+  end
+
+  describe '作成に於いて' do
+    context '作家の自動作成' do
+      it '作家が作成されている' do
+        lambda {
+          @user = Factory( :user_yas)
+        }.should change(Author, :count)
+      end
+      it '作家とユーザがリンクされている' do
+        @user = Factory( :user_yas)
+        Author.find_by_user_id(@user.id).should_not eq nil
+      end
+    end
+  end
+  
+  describe 'トークン作成に於いて' do
+    before do
+      @user = Factory( :user_yas)
+    end
+    it 'トークンが変更されている' do
+      lambda {
+        @user.create_token
+      }.should change(@user, :authentication_token)
+    end
+    it 'トークンが作成されている' do
+      @user.create_token
+      @user.authentication_token.should_not be_empty
+    end
+  end
+  
+  describe 'トークン削除に於いて' do
+    before do
+      @user = Factory( :user_yas)
+      @user.create_token
+    end
+    it 'トークンが変更されている' do
+      lambda {
+        @user.delete_token
+      }.should change(@user, :authentication_token)
+    end
+    it 'トークンが削除されている' do
+      @user.delete_token
+      @user.authentication_token.should be_blank
+    end
+  end
 end
diff --git a/spec/requests/artists_spec.rb b/spec/requests/artists_spec.rb
deleted file mode 100644 (file)
index ce39a8f..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "Artists" do
-  describe "GET /artists" do
-    it "works! (now write some real specs)" do
-      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
-      get artists_path
-      response.status.should be(200)
-    end
-  end
-end
diff --git a/spec/requests/baloon_templates_spec.rb b/spec/requests/baloon_templates_spec.rb
deleted file mode 100644 (file)
index 0826e76..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "BaloonTemplates" do
-  describe "GET /baloon_templates" do
-    it "works! (now write some real specs)" do
-      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
-      get baloon_templates_path
-      response.status.should be(200)
-    end
-  end
-end
diff --git a/spec/requests/baloon_types_spec.rb b/spec/requests/baloon_types_spec.rb
deleted file mode 100644 (file)
index ecda4f5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "BaloonTypes" do
-  describe "GET /baloon_types" do
-    it "works! (now write some real specs)" do
-      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
-      get baloon_types_path
-      response.status.should be(200)
-    end
-  end
-end
diff --git a/spec/requests/baloons_spec.rb b/spec/requests/baloons_spec.rb
deleted file mode 100644 (file)
index 1c613b7..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "Baloons" do
-  describe "GET /baloons" do
-    it "works! (now write some real specs)" do
-      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
-      get baloons_path
-      response.status.should be(200)
-    end
-  end
-end
diff --git a/spec/requests/common_licenses_spec.rb b/spec/requests/common_licenses_spec.rb
deleted file mode 100644 (file)
index 6dad585..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "CommonLicenses" do
-  describe "GET /common_licenses" do
-    it "works! (now write some real specs)" do
-      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
-      get common_licenses_path
-      response.status.should be(200)
-    end
-  end
-end
diff --git a/spec/requests/licenses_spec.rb b/spec/requests/licenses_spec.rb
deleted file mode 100644 (file)
index fbbe38a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "Licenses" do
-  describe "GET /licenses" do
-    it "works! (now write some real specs)" do
-      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
-      get licenses_path
-      response.status.should be(200)
-    end
-  end
-end
diff --git a/spec/requests/original_licenses_spec.rb b/spec/requests/original_licenses_spec.rb
deleted file mode 100644 (file)
index 6b12b4a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "OriginalLicenses" do
-  describe "GET /original_licenses" do
-    it "works! (now write some real specs)" do
-      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
-      get original_licenses_path
-      response.status.should be(200)
-    end
-  end
-end
diff --git a/spec/requests/original_pictures_spec.rb b/spec/requests/original_pictures_spec.rb
deleted file mode 100644 (file)
index f0330b9..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "OriginalPictures" do
-  describe "GET /original_pictures" do
-    it "works! (now write some real specs)" do
-      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
-      get original_pictures_path
-      response.status.should be(200)
-    end
-  end
-end
diff --git a/spec/requests/panels_spec.rb b/spec/requests/panels_spec.rb
deleted file mode 100644 (file)
index b488811..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "Panels" do
-  describe "GET /panels" do
-    it "works! (now write some real specs)" do
-      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
-      get panels_path
-      response.status.should be(200)
-    end
-  end
-end
diff --git a/spec/requests/pictures_spec.rb b/spec/requests/pictures_spec.rb
deleted file mode 100644 (file)
index 18c2c10..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "Pictures" do
-  describe "GET /pictures" do
-    it "works! (now write some real specs)" do
-      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
-      get pictures_path
-      response.status.should be(200)
-    end
-  end
-end
diff --git a/spec/requests/source_pictures_spec.rb b/spec/requests/source_pictures_spec.rb
deleted file mode 100644 (file)
index f7bfb9c..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "SourcePictures" do
-  describe "GET /source_pictures" do
-    it "works! (now write some real specs)" do
-      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
-      get source_pictures_path
-      response.status.should be(200)
-    end
-  end
-end
diff --git a/spec/requests/speach_baloons_spec.rb b/spec/requests/speach_baloons_spec.rb
deleted file mode 100644 (file)
index 3d1998f..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "SpeachBaloons" do
-  describe "GET /speach_baloons" do
-    it "works! (now write some real specs)" do
-      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
-      get speach_baloons_path
-      response.status.should be(200)
-    end
-  end
-end
diff --git a/spec/requests/speach_templates_spec.rb b/spec/requests/speach_templates_spec.rb
deleted file mode 100644 (file)
index 3808822..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "SpeachTemplates" do
-  describe "GET /speach_templates" do
-    it "works! (now write some real specs)" do
-      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
-      get speach_templates_path
-      response.status.should be(200)
-    end
-  end
-end
diff --git a/spec/requests/speachbaloons_spec.rb b/spec/requests/speachbaloons_spec.rb
deleted file mode 100644 (file)
index a1b9402..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "Speachbaloons" do
-  describe "GET /speachbaloons" do
-    it "works! (now write some real specs)" do
-      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
-      get speachbaloons_path
-      response.status.should be(200)
-    end
-  end
-end
diff --git a/spec/requests/speaches_spec.rb b/spec/requests/speaches_spec.rb
deleted file mode 100644 (file)
index 9fc5704..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "Speaches" do
-  describe "GET /speaches" do
-    it "works! (now write some real specs)" do
-      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
-      get speaches_path
-      response.status.should be(200)
-    end
-  end
-end
diff --git a/spec/requests/system_pictures_spec.rb b/spec/requests/system_pictures_spec.rb
deleted file mode 100644 (file)
index bc399e5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "SystemPictures" do
-  describe "GET /system_pictures" do
-    it "works! (now write some real specs)" do
-      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
-      get system_pictures_path
-      response.status.should be(200)
-    end
-  end
-end
diff --git a/spec/routing/artists_routing_spec.rb b/spec/routing/artists_routing_spec.rb
deleted file mode 100644 (file)
index 9c399fb..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-require "spec_helper"
-
-describe ArtistsController do
-  describe "routing" do
-
-    it "routes to #index" do
-      get("/artists").should route_to("artists#index")
-    end
-
-    it "routes to #new" do
-      get("/artists/new").should route_to("artists#new")
-    end
-
-    it "routes to #show" do
-      get("/artists/1").should route_to("artists#show", :id => "1")
-    end
-
-    it "routes to #edit" do
-      get("/artists/1/edit").should route_to("artists#edit", :id => "1")
-    end
-
-    it "routes to #create" do
-      post("/artists").should route_to("artists#create")
-    end
-
-    it "routes to #update" do
-      put("/artists/1").should route_to("artists#update", :id => "1")
-    end
-
-    it "routes to #destroy" do
-      delete("/artists/1").should route_to("artists#destroy", :id => "1")
-    end
-
-  end
-end
diff --git a/spec/routing/baloon_templates_routing_spec.rb b/spec/routing/baloon_templates_routing_spec.rb
deleted file mode 100644 (file)
index 8d7f985..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-require "spec_helper"
-
-describe BaloonTemplatesController do
-  describe "routing" do
-
-    it "routes to #index" do
-      get("/baloon_templates").should route_to("baloon_templates#index")
-    end
-
-    it "routes to #new" do
-      get("/baloon_templates/new").should route_to("baloon_templates#new")
-    end
-
-    it "routes to #show" do
-      get("/baloon_templates/1").should route_to("baloon_templates#show", :id => "1")
-    end
-
-    it "routes to #edit" do
-      get("/baloon_templates/1/edit").should route_to("baloon_templates#edit", :id => "1")
-    end
-
-    it "routes to #create" do
-      post("/baloon_templates").should route_to("baloon_templates#create")
-    end
-
-    it "routes to #update" do
-      put("/baloon_templates/1").should route_to("baloon_templates#update", :id => "1")
-    end
-
-    it "routes to #destroy" do
-      delete("/baloon_templates/1").should route_to("baloon_templates#destroy", :id => "1")
-    end
-
-  end
-end
diff --git a/spec/routing/baloon_types_routing_spec.rb b/spec/routing/baloon_types_routing_spec.rb
deleted file mode 100644 (file)
index add3f9d..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-require "spec_helper"
-
-describe BaloonTypesController do
-  describe "routing" do
-
-    it "routes to #index" do
-      get("/baloon_types").should route_to("baloon_types#index")
-    end
-
-    it "routes to #new" do
-      get("/baloon_types/new").should route_to("baloon_types#new")
-    end
-
-    it "routes to #show" do
-      get("/baloon_types/1").should route_to("baloon_types#show", :id => "1")
-    end
-
-    it "routes to #edit" do
-      get("/baloon_types/1/edit").should route_to("baloon_types#edit", :id => "1")
-    end
-
-    it "routes to #create" do
-      post("/baloon_types").should route_to("baloon_types#create")
-    end
-
-    it "routes to #update" do
-      put("/baloon_types/1").should route_to("baloon_types#update", :id => "1")
-    end
-
-    it "routes to #destroy" do
-      delete("/baloon_types/1").should route_to("baloon_types#destroy", :id => "1")
-    end
-
-  end
-end
diff --git a/spec/routing/baloons_routing_spec.rb b/spec/routing/baloons_routing_spec.rb
deleted file mode 100644 (file)
index b6d4572..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-require "spec_helper"
-
-describe BaloonsController do
-  describe "routing" do
-
-    it "routes to #index" do
-      get("/baloons").should route_to("baloons#index")
-    end
-
-    it "routes to #new" do
-      get("/baloons/new").should route_to("baloons#new")
-    end
-
-    it "routes to #show" do
-      get("/baloons/1").should route_to("baloons#show", :id => "1")
-    end
-
-    it "routes to #edit" do
-      get("/baloons/1/edit").should route_to("baloons#edit", :id => "1")
-    end
-
-    it "routes to #create" do
-      post("/baloons").should route_to("baloons#create")
-    end
-
-    it "routes to #update" do
-      put("/baloons/1").should route_to("baloons#update", :id => "1")
-    end
-
-    it "routes to #destroy" do
-      delete("/baloons/1").should route_to("baloons#destroy", :id => "1")
-    end
-
-  end
-end
diff --git a/spec/routing/common_licenses_routing_spec.rb b/spec/routing/common_licenses_routing_spec.rb
deleted file mode 100644 (file)
index 9e945f6..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-require "spec_helper"
-
-describe CommonLicensesController do
-  describe "routing" do
-
-    it "routes to #index" do
-      get("/common_licenses").should route_to("common_licenses#index")
-    end
-
-    it "routes to #new" do
-      get("/common_licenses/new").should route_to("common_licenses#new")
-    end
-
-    it "routes to #show" do
-      get("/common_licenses/1").should route_to("common_licenses#show", :id => "1")
-    end
-
-    it "routes to #edit" do
-      get("/common_licenses/1/edit").should route_to("common_licenses#edit", :id => "1")
-    end
-
-    it "routes to #create" do
-      post("/common_licenses").should route_to("common_licenses#create")
-    end
-
-    it "routes to #update" do
-      put("/common_licenses/1").should route_to("common_licenses#update", :id => "1")
-    end
-
-    it "routes to #destroy" do
-      delete("/common_licenses/1").should route_to("common_licenses#destroy", :id => "1")
-    end
-
-  end
-end
diff --git a/spec/routing/licenses_routing_spec.rb b/spec/routing/licenses_routing_spec.rb
deleted file mode 100644 (file)
index c09d76d..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-require "spec_helper"
-
-describe LicensesController do
-  describe "routing" do
-
-    it "routes to #index" do
-      get("/licenses").should route_to("licenses#index")
-    end
-
-    it "routes to #new" do
-      get("/licenses/new").should route_to("licenses#new")
-    end
-
-    it "routes to #show" do
-      get("/licenses/1").should route_to("licenses#show", :id => "1")
-    end
-
-    it "routes to #edit" do
-      get("/licenses/1/edit").should route_to("licenses#edit", :id => "1")
-    end
-
-    it "routes to #create" do
-      post("/licenses").should route_to("licenses#create")
-    end
-
-    it "routes to #update" do
-      put("/licenses/1").should route_to("licenses#update", :id => "1")
-    end
-
-    it "routes to #destroy" do
-      delete("/licenses/1").should route_to("licenses#destroy", :id => "1")
-    end
-
-  end
-end
diff --git a/spec/routing/original_licenses_routing_spec.rb b/spec/routing/original_licenses_routing_spec.rb
deleted file mode 100644 (file)
index 4905050..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-require "spec_helper"
-
-describe OriginalLicensesController do
-  describe "routing" do
-
-    it "routes to #index" do
-      get("/original_licenses").should route_to("original_licenses#index")
-    end
-
-    it "routes to #new" do
-      get("/original_licenses/new").should route_to("original_licenses#new")
-    end
-
-    it "routes to #show" do
-      get("/original_licenses/1").should route_to("original_licenses#show", :id => "1")
-    end
-
-    it "routes to #edit" do
-      get("/original_licenses/1/edit").should route_to("original_licenses#edit", :id => "1")
-    end
-
-    it "routes to #create" do
-      post("/original_licenses").should route_to("original_licenses#create")
-    end
-
-    it "routes to #update" do
-      put("/original_licenses/1").should route_to("original_licenses#update", :id => "1")
-    end
-
-    it "routes to #destroy" do
-      delete("/original_licenses/1").should route_to("original_licenses#destroy", :id => "1")
-    end
-
-  end
-end
diff --git a/spec/routing/original_pictures_routing_spec.rb b/spec/routing/original_pictures_routing_spec.rb
deleted file mode 100644 (file)
index b4558c8..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-require "spec_helper"
-
-describe OriginalPicturesController do
-  describe "routing" do
-
-    it "routes to #index" do
-      get("/original_pictures").should route_to("original_pictures#index")
-    end
-
-    it "routes to #new" do
-      get("/original_pictures/new").should route_to("original_pictures#new")
-    end
-
-    it "routes to #show" do
-      get("/original_pictures/1").should route_to("original_pictures#show", :id => "1")
-    end
-
-    it "routes to #edit" do
-      get("/original_pictures/1/edit").should route_to("original_pictures#edit", :id => "1")
-    end
-
-    it "routes to #create" do
-      post("/original_pictures").should route_to("original_pictures#create")
-    end
-
-    it "routes to #update" do
-      put("/original_pictures/1").should route_to("original_pictures#update", :id => "1")
-    end
-
-    it "routes to #destroy" do
-      delete("/original_pictures/1").should route_to("original_pictures#destroy", :id => "1")
-    end
-
-  end
-end
diff --git a/spec/routing/panels_routing_spec.rb b/spec/routing/panels_routing_spec.rb
deleted file mode 100644 (file)
index 973c126..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-require "spec_helper"
-
-describe PanelsController do
-  describe "routing" do
-
-    it "routes to #index" do
-      get("/panels").should route_to("panels#index")
-    end
-
-    it "routes to #new" do
-      get("/panels/new").should route_to("panels#new")
-    end
-
-    it "routes to #show" do
-      get("/panels/1").should route_to("panels#show", :id => "1")
-    end
-
-    it "routes to #edit" do
-      get("/panels/1/edit").should route_to("panels#edit", :id => "1")
-    end
-
-    it "routes to #create" do
-      post("/panels").should route_to("panels#create")
-    end
-
-    it "routes to #update" do
-      put("/panels/1").should route_to("panels#update", :id => "1")
-    end
-
-    it "routes to #destroy" do
-      delete("/panels/1").should route_to("panels#destroy", :id => "1")
-    end
-
-  end
-end
diff --git a/spec/routing/pictures_routing_spec.rb b/spec/routing/pictures_routing_spec.rb
deleted file mode 100644 (file)
index 69c6877..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-require "spec_helper"
-
-describe PicturesController do
-  describe "routing" do
-
-    it "routes to #index" do
-      get("/pictures").should route_to("pictures#index")
-    end
-
-    it "routes to #new" do
-      get("/pictures/new").should route_to("pictures#new")
-    end
-
-    it "routes to #show" do
-      get("/pictures/1").should route_to("pictures#show", :id => "1")
-    end
-
-    it "routes to #edit" do
-      get("/pictures/1/edit").should route_to("pictures#edit", :id => "1")
-    end
-
-    it "routes to #create" do
-      post("/pictures").should route_to("pictures#create")
-    end
-
-    it "routes to #update" do
-      put("/pictures/1").should route_to("pictures#update", :id => "1")
-    end
-
-    it "routes to #destroy" do
-      delete("/pictures/1").should route_to("pictures#destroy", :id => "1")
-    end
-
-  end
-end
diff --git a/spec/routing/source_pictures_routing_spec.rb b/spec/routing/source_pictures_routing_spec.rb
deleted file mode 100644 (file)
index dcb207c..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-require "spec_helper"
-
-describe SourcePicturesController do
-  describe "routing" do
-
-    it "routes to #index" do
-      get("/source_pictures").should route_to("source_pictures#index")
-    end
-
-    it "routes to #new" do
-      get("/source_pictures/new").should route_to("source_pictures#new")
-    end
-
-    it "routes to #show" do
-      get("/source_pictures/1").should route_to("source_pictures#show", :id => "1")
-    end
-
-    it "routes to #edit" do
-      get("/source_pictures/1/edit").should route_to("source_pictures#edit", :id => "1")
-    end
-
-    it "routes to #create" do
-      post("/source_pictures").should route_to("source_pictures#create")
-    end
-
-    it "routes to #update" do
-      put("/source_pictures/1").should route_to("source_pictures#update", :id => "1")
-    end
-
-    it "routes to #destroy" do
-      delete("/source_pictures/1").should route_to("source_pictures#destroy", :id => "1")
-    end
-
-  end
-end
diff --git a/spec/routing/speach_baloons_routing_spec.rb b/spec/routing/speach_baloons_routing_spec.rb
deleted file mode 100644 (file)
index c52d53f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-require "spec_helper"
-
-describe SpeachBaloonsController do
-  describe "routing" do
-
-    it "routes to #index" do
-      get("/speach_baloons").should route_to("speach_baloons#index")
-    end
-
-    it "routes to #new" do
-      get("/speach_baloons/new").should route_to("speach_baloons#new")
-    end
-
-    it "routes to #show" do
-      get("/speach_baloons/1").should route_to("speach_baloons#show", :id => "1")
-    end
-
-    it "routes to #edit" do
-      get("/speach_baloons/1/edit").should route_to("speach_baloons#edit", :id => "1")
-    end
-
-    it "routes to #create" do
-      post("/speach_baloons").should route_to("speach_baloons#create")
-    end
-
-    it "routes to #update" do
-      put("/speach_baloons/1").should route_to("speach_baloons#update", :id => "1")
-    end
-
-    it "routes to #destroy" do
-      delete("/speach_baloons/1").should route_to("speach_baloons#destroy", :id => "1")
-    end
-
-  end
-end
diff --git a/spec/routing/speach_templates_routing_spec.rb b/spec/routing/speach_templates_routing_spec.rb
deleted file mode 100644 (file)
index da923f1..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-require "spec_helper"
-
-describe SpeachTemplatesController do
-  describe "routing" do
-
-    it "routes to #index" do
-      get("/speach_templates").should route_to("speach_templates#index")
-    end
-
-    it "routes to #new" do
-      get("/speach_templates/new").should route_to("speach_templates#new")
-    end
-
-    it "routes to #show" do
-      get("/speach_templates/1").should route_to("speach_templates#show", :id => "1")
-    end
-
-    it "routes to #edit" do
-      get("/speach_templates/1/edit").should route_to("speach_templates#edit", :id => "1")
-    end
-
-    it "routes to #create" do
-      post("/speach_templates").should route_to("speach_templates#create")
-    end
-
-    it "routes to #update" do
-      put("/speach_templates/1").should route_to("speach_templates#update", :id => "1")
-    end
-
-    it "routes to #destroy" do
-      delete("/speach_templates/1").should route_to("speach_templates#destroy", :id => "1")
-    end
-
-  end
-end
diff --git a/spec/routing/speachbaloons_routing_spec.rb b/spec/routing/speachbaloons_routing_spec.rb
deleted file mode 100644 (file)
index f9c5c60..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-require "spec_helper"
-
-describe SpeachbaloonsController do
-  describe "routing" do
-
-    it "routes to #index" do
-      get("/speachbaloons").should route_to("speachbaloons#index")
-    end
-
-    it "routes to #new" do
-      get("/speachbaloons/new").should route_to("speachbaloons#new")
-    end
-
-    it "routes to #show" do
-      get("/speachbaloons/1").should route_to("speachbaloons#show", :id => "1")
-    end
-
-    it "routes to #edit" do
-      get("/speachbaloons/1/edit").should route_to("speachbaloons#edit", :id => "1")
-    end
-
-    it "routes to #create" do
-      post("/speachbaloons").should route_to("speachbaloons#create")
-    end
-
-    it "routes to #update" do
-      put("/speachbaloons/1").should route_to("speachbaloons#update", :id => "1")
-    end
-
-    it "routes to #destroy" do
-      delete("/speachbaloons/1").should route_to("speachbaloons#destroy", :id => "1")
-    end
-
-  end
-end
diff --git a/spec/routing/speaches_routing_spec.rb b/spec/routing/speaches_routing_spec.rb
deleted file mode 100644 (file)
index 5debf26..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-require "spec_helper"
-
-describe SpeachesController do
-  describe "routing" do
-
-    it "routes to #index" do
-      get("/speaches").should route_to("speaches#index")
-    end
-
-    it "routes to #new" do
-      get("/speaches/new").should route_to("speaches#new")
-    end
-
-    it "routes to #show" do
-      get("/speaches/1").should route_to("speaches#show", :id => "1")
-    end
-
-    it "routes to #edit" do
-      get("/speaches/1/edit").should route_to("speaches#edit", :id => "1")
-    end
-
-    it "routes to #create" do
-      post("/speaches").should route_to("speaches#create")
-    end
-
-    it "routes to #update" do
-      put("/speaches/1").should route_to("speaches#update", :id => "1")
-    end
-
-    it "routes to #destroy" do
-      delete("/speaches/1").should route_to("speaches#destroy", :id => "1")
-    end
-
-  end
-end
diff --git a/spec/routing/system_pictures_routing_spec.rb b/spec/routing/system_pictures_routing_spec.rb
deleted file mode 100644 (file)
index 2239562..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-require "spec_helper"
-
-describe SystemPicturesController do
-  describe "routing" do
-
-    it "routes to #index" do
-      get("/system_pictures").should route_to("system_pictures#index")
-    end
-
-    it "routes to #new" do
-      get("/system_pictures/new").should route_to("system_pictures#new")
-    end
-
-    it "routes to #show" do
-      get("/system_pictures/1").should route_to("system_pictures#show", :id => "1")
-    end
-
-    it "routes to #edit" do
-      get("/system_pictures/1/edit").should route_to("system_pictures#edit", :id => "1")
-    end
-
-    it "routes to #create" do
-      post("/system_pictures").should route_to("system_pictures#create")
-    end
-
-    it "routes to #update" do
-      put("/system_pictures/1").should route_to("system_pictures#update", :id => "1")
-    end
-
-    it "routes to #destroy" do
-      delete("/system_pictures/1").should route_to("system_pictures#destroy", :id => "1")
-    end
-
-  end
-end
diff --git a/spec/views/artists/edit.html.erb_spec.rb b/spec/views/artists/edit.html.erb_spec.rb
deleted file mode 100644 (file)
index a3a2781..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "artists/edit.html.erb" do
-  before(:each) do
-    @artist = assign(:artist, stub_model(Artist))
-  end
-
-  it "renders the edit artist form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => artists_path(@artist), :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/artists/index.html.erb_spec.rb b/spec/views/artists/index.html.erb_spec.rb
deleted file mode 100644 (file)
index de4959a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe "artists/index.html.erb" do
-  before(:each) do
-    assign(:artists, [
-      stub_model(Artist),
-      stub_model(Artist)
-    ])
-  end
-
-  it "renders a list of artists" do
-    render
-  end
-end
diff --git a/spec/views/artists/new.html.erb_spec.rb b/spec/views/artists/new.html.erb_spec.rb
deleted file mode 100644 (file)
index bff7d48..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "artists/new.html.erb" do
-  before(:each) do
-    assign(:artist, stub_model(Artist).as_new_record)
-  end
-
-  it "renders new artist form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => artists_path, :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/artists/show.html.erb_spec.rb b/spec/views/artists/show.html.erb_spec.rb
deleted file mode 100644 (file)
index 76cac49..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "artists/show.html.erb" do
-  before(:each) do
-    @artist = assign(:artist, stub_model(Artist))
-  end
-
-  it "renders attributes in <p>" do
-    render
-  end
-end
diff --git a/spec/views/baloon_templates/edit.html.erb_spec.rb b/spec/views/baloon_templates/edit.html.erb_spec.rb
deleted file mode 100644 (file)
index 081b4ee..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "baloon_templates/edit.html.erb" do
-  before(:each) do
-    @baloon_template = assign(:baloon_template, stub_model(BaloonTemplate))
-  end
-
-  it "renders the edit baloon_template form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => baloon_templates_path(@baloon_template), :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/baloon_templates/index.html.erb_spec.rb b/spec/views/baloon_templates/index.html.erb_spec.rb
deleted file mode 100644 (file)
index 7ff4294..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe "baloon_templates/index.html.erb" do
-  before(:each) do
-    assign(:baloon_templates, [
-      stub_model(BaloonTemplate),
-      stub_model(BaloonTemplate)
-    ])
-  end
-
-  it "renders a list of baloon_templates" do
-    render
-  end
-end
diff --git a/spec/views/baloon_templates/new.html.erb_spec.rb b/spec/views/baloon_templates/new.html.erb_spec.rb
deleted file mode 100644 (file)
index fa5c809..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "baloon_templates/new.html.erb" do
-  before(:each) do
-    assign(:baloon_template, stub_model(BaloonTemplate).as_new_record)
-  end
-
-  it "renders new baloon_template form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => baloon_templates_path, :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/baloon_templates/show.html.erb_spec.rb b/spec/views/baloon_templates/show.html.erb_spec.rb
deleted file mode 100644 (file)
index 6335727..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "baloon_templates/show.html.erb" do
-  before(:each) do
-    @baloon_template = assign(:baloon_template, stub_model(BaloonTemplate))
-  end
-
-  it "renders attributes in <p>" do
-    render
-  end
-end
diff --git a/spec/views/baloon_types/edit.html.erb_spec.rb b/spec/views/baloon_types/edit.html.erb_spec.rb
deleted file mode 100644 (file)
index 3ffc1d0..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "baloon_types/edit.html.erb" do
-  before(:each) do
-    @baloon_type = assign(:baloon_type, stub_model(BaloonType))
-  end
-
-  it "renders the edit baloon_type form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => baloon_types_path(@baloon_type), :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/baloon_types/index.html.erb_spec.rb b/spec/views/baloon_types/index.html.erb_spec.rb
deleted file mode 100644 (file)
index 3b0e863..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe "baloon_types/index.html.erb" do
-  before(:each) do
-    assign(:baloon_types, [
-      stub_model(BaloonType),
-      stub_model(BaloonType)
-    ])
-  end
-
-  it "renders a list of baloon_types" do
-    render
-  end
-end
diff --git a/spec/views/baloon_types/new.html.erb_spec.rb b/spec/views/baloon_types/new.html.erb_spec.rb
deleted file mode 100644 (file)
index 9c950b9..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "baloon_types/new.html.erb" do
-  before(:each) do
-    assign(:baloon_type, stub_model(BaloonType).as_new_record)
-  end
-
-  it "renders new baloon_type form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => baloon_types_path, :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/baloon_types/show.html.erb_spec.rb b/spec/views/baloon_types/show.html.erb_spec.rb
deleted file mode 100644 (file)
index 765570a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "baloon_types/show.html.erb" do
-  before(:each) do
-    @baloon_type = assign(:baloon_type, stub_model(BaloonType))
-  end
-
-  it "renders attributes in <p>" do
-    render
-  end
-end
diff --git a/spec/views/baloons/edit.html.erb_spec.rb b/spec/views/baloons/edit.html.erb_spec.rb
deleted file mode 100644 (file)
index 2c9b488..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "baloons/edit.html.erb" do
-  before(:each) do
-    @baloon = assign(:baloon, stub_model(Baloon))
-  end
-
-  it "renders the edit baloon form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => baloons_path(@baloon), :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/baloons/index.html.erb_spec.rb b/spec/views/baloons/index.html.erb_spec.rb
deleted file mode 100644 (file)
index c9d7c35..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe "baloons/index.html.erb" do
-  before(:each) do
-    assign(:baloons, [
-      stub_model(Baloon),
-      stub_model(Baloon)
-    ])
-  end
-
-  it "renders a list of baloons" do
-    render
-  end
-end
diff --git a/spec/views/baloons/new.html.erb_spec.rb b/spec/views/baloons/new.html.erb_spec.rb
deleted file mode 100644 (file)
index 47d89e1..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "baloons/new.html.erb" do
-  before(:each) do
-    assign(:baloon, stub_model(Baloon).as_new_record)
-  end
-
-  it "renders new baloon form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => baloons_path, :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/baloons/show.html.erb_spec.rb b/spec/views/baloons/show.html.erb_spec.rb
deleted file mode 100644 (file)
index 2edae9d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "baloons/show.html.erb" do
-  before(:each) do
-    @baloon = assign(:baloon, stub_model(Baloon))
-  end
-
-  it "renders attributes in <p>" do
-    render
-  end
-end
diff --git a/spec/views/common_licenses/edit.html.erb_spec.rb b/spec/views/common_licenses/edit.html.erb_spec.rb
deleted file mode 100644 (file)
index 0e13ac4..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "common_licenses/edit.html.erb" do
-  before(:each) do
-    @common_license = assign(:common_license, stub_model(CommonLicense))
-  end
-
-  it "renders the edit common_license form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => common_licenses_path(@common_license), :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/common_licenses/index.html.erb_spec.rb b/spec/views/common_licenses/index.html.erb_spec.rb
deleted file mode 100644 (file)
index 8bde076..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe "common_licenses/index.html.erb" do
-  before(:each) do
-    assign(:common_licenses, [
-      stub_model(CommonLicense),
-      stub_model(CommonLicense)
-    ])
-  end
-
-  it "renders a list of common_licenses" do
-    render
-  end
-end
diff --git a/spec/views/common_licenses/new.html.erb_spec.rb b/spec/views/common_licenses/new.html.erb_spec.rb
deleted file mode 100644 (file)
index 358d452..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "common_licenses/new.html.erb" do
-  before(:each) do
-    assign(:common_license, stub_model(CommonLicense).as_new_record)
-  end
-
-  it "renders new common_license form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => common_licenses_path, :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/common_licenses/show.html.erb_spec.rb b/spec/views/common_licenses/show.html.erb_spec.rb
deleted file mode 100644 (file)
index 5c2d07e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "common_licenses/show.html.erb" do
-  before(:each) do
-    @common_license = assign(:common_license, stub_model(CommonLicense))
-  end
-
-  it "renders attributes in <p>" do
-    render
-  end
-end
diff --git a/spec/views/licenses/edit.html.erb_spec.rb b/spec/views/licenses/edit.html.erb_spec.rb
deleted file mode 100644 (file)
index 8a542c0..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "licenses/edit.html.erb" do
-  before(:each) do
-    @license = assign(:license, stub_model(License))
-  end
-
-  it "renders the edit license form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => licenses_path(@license), :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/licenses/index.html.erb_spec.rb b/spec/views/licenses/index.html.erb_spec.rb
deleted file mode 100644 (file)
index 8ddf810..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe "licenses/index.html.erb" do
-  before(:each) do
-    assign(:licenses, [
-      stub_model(License),
-      stub_model(License)
-    ])
-  end
-
-  it "renders a list of licenses" do
-    render
-  end
-end
diff --git a/spec/views/licenses/new.html.erb_spec.rb b/spec/views/licenses/new.html.erb_spec.rb
deleted file mode 100644 (file)
index cb6e05a..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "licenses/new.html.erb" do
-  before(:each) do
-    assign(:license, stub_model(License).as_new_record)
-  end
-
-  it "renders new license form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => licenses_path, :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/licenses/show.html.erb_spec.rb b/spec/views/licenses/show.html.erb_spec.rb
deleted file mode 100644 (file)
index 58bded3..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "licenses/show.html.erb" do
-  before(:each) do
-    @license = assign(:license, stub_model(License))
-  end
-
-  it "renders attributes in <p>" do
-    render
-  end
-end
diff --git a/spec/views/original_licenses/edit.html.erb_spec.rb b/spec/views/original_licenses/edit.html.erb_spec.rb
deleted file mode 100644 (file)
index d96e298..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "original_licenses/edit.html.erb" do
-  before(:each) do
-    @original_license = assign(:original_license, stub_model(OriginalLicense))
-  end
-
-  it "renders the edit original_license form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => original_licenses_path(@original_license), :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/original_licenses/index.html.erb_spec.rb b/spec/views/original_licenses/index.html.erb_spec.rb
deleted file mode 100644 (file)
index f410d80..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe "original_licenses/index.html.erb" do
-  before(:each) do
-    assign(:original_licenses, [
-      stub_model(OriginalLicense),
-      stub_model(OriginalLicense)
-    ])
-  end
-
-  it "renders a list of original_licenses" do
-    render
-  end
-end
diff --git a/spec/views/original_licenses/new.html.erb_spec.rb b/spec/views/original_licenses/new.html.erb_spec.rb
deleted file mode 100644 (file)
index 5ab1c50..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "original_licenses/new.html.erb" do
-  before(:each) do
-    assign(:original_license, stub_model(OriginalLicense).as_new_record)
-  end
-
-  it "renders new original_license form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => original_licenses_path, :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/original_licenses/show.html.erb_spec.rb b/spec/views/original_licenses/show.html.erb_spec.rb
deleted file mode 100644 (file)
index d703f90..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "original_licenses/show.html.erb" do
-  before(:each) do
-    @original_license = assign(:original_license, stub_model(OriginalLicense))
-  end
-
-  it "renders attributes in <p>" do
-    render
-  end
-end
diff --git a/spec/views/original_pictures/edit.html.erb_spec.rb b/spec/views/original_pictures/edit.html.erb_spec.rb
deleted file mode 100644 (file)
index 7cb7d2c..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "original_pictures/edit.html.erb" do
-  before(:each) do
-    @original_picture = assign(:original_picture, stub_model(OriginalPicture))
-  end
-
-  it "renders the edit original_picture form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => original_pictures_path(@original_picture), :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/original_pictures/index.html.erb_spec.rb b/spec/views/original_pictures/index.html.erb_spec.rb
deleted file mode 100644 (file)
index 7634112..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe "original_pictures/index.html.erb" do
-  before(:each) do
-    assign(:original_pictures, [
-      stub_model(OriginalPicture),
-      stub_model(OriginalPicture)
-    ])
-  end
-
-  it "renders a list of original_pictures" do
-    render
-  end
-end
diff --git a/spec/views/original_pictures/new.html.erb_spec.rb b/spec/views/original_pictures/new.html.erb_spec.rb
deleted file mode 100644 (file)
index ce1cba0..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "original_pictures/new.html.erb" do
-  before(:each) do
-    assign(:original_picture, stub_model(OriginalPicture).as_new_record)
-  end
-
-  it "renders new original_picture form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => original_pictures_path, :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/original_pictures/show.html.erb_spec.rb b/spec/views/original_pictures/show.html.erb_spec.rb
deleted file mode 100644 (file)
index 51184ac..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "original_pictures/show.html.erb" do
-  before(:each) do
-    @original_picture = assign(:original_picture, stub_model(OriginalPicture))
-  end
-
-  it "renders attributes in <p>" do
-    render
-  end
-end
diff --git a/spec/views/panels/edit.html.erb_spec.rb b/spec/views/panels/edit.html.erb_spec.rb
deleted file mode 100644 (file)
index ac7a29f..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "panels/edit.html.erb" do
-  before(:each) do
-    @panel = assign(:panel, stub_model(Panel))
-  end
-
-  it "renders the edit panel form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => panels_path(@panel), :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/panels/index.html.erb_spec.rb b/spec/views/panels/index.html.erb_spec.rb
deleted file mode 100644 (file)
index b2a5172..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe "panels/index.html.erb" do
-  before(:each) do
-    assign(:panels, [
-      stub_model(Panel),
-      stub_model(Panel)
-    ])
-  end
-
-  it "renders a list of panels" do
-    render
-  end
-end
diff --git a/spec/views/panels/new.html.erb_spec.rb b/spec/views/panels/new.html.erb_spec.rb
deleted file mode 100644 (file)
index afcefb4..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "panels/new.html.erb" do
-  before(:each) do
-    assign(:panel, stub_model(Panel).as_new_record)
-  end
-
-  it "renders new panel form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => panels_path, :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/panels/show.html.erb_spec.rb b/spec/views/panels/show.html.erb_spec.rb
deleted file mode 100644 (file)
index da66f77..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "panels/show.html.erb" do
-  before(:each) do
-    @panel = assign(:panel, stub_model(Panel))
-  end
-
-  it "renders attributes in <p>" do
-    render
-  end
-end
diff --git a/spec/views/pictures/edit.html.erb_spec.rb b/spec/views/pictures/edit.html.erb_spec.rb
deleted file mode 100644 (file)
index a9f82b1..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "pictures/edit.html.erb" do
-  before(:each) do
-    @picture = assign(:picture, stub_model(Picture))
-  end
-
-  it "renders the edit picture form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => pictures_path(@picture), :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/pictures/index.html.erb_spec.rb b/spec/views/pictures/index.html.erb_spec.rb
deleted file mode 100644 (file)
index 06f977b..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe "pictures/index.html.erb" do
-  before(:each) do
-    assign(:pictures, [
-      stub_model(Picture),
-      stub_model(Picture)
-    ])
-  end
-
-  it "renders a list of pictures" do
-    render
-  end
-end
diff --git a/spec/views/pictures/new.html.erb_spec.rb b/spec/views/pictures/new.html.erb_spec.rb
deleted file mode 100644 (file)
index dde0348..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "pictures/new.html.erb" do
-  before(:each) do
-    assign(:picture, stub_model(Picture).as_new_record)
-  end
-
-  it "renders new picture form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => pictures_path, :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/pictures/show.html.erb_spec.rb b/spec/views/pictures/show.html.erb_spec.rb
deleted file mode 100644 (file)
index dec106e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "pictures/show.html.erb" do
-  before(:each) do
-    @picture = assign(:picture, stub_model(Picture))
-  end
-
-  it "renders attributes in <p>" do
-    render
-  end
-end
diff --git a/spec/views/source_pictures/edit.html.erb_spec.rb b/spec/views/source_pictures/edit.html.erb_spec.rb
deleted file mode 100644 (file)
index c7eb6d7..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "source_pictures/edit.html.erb" do
-  before(:each) do
-    @source_picture = assign(:source_picture, stub_model(SourcePicture))
-  end
-
-  it "renders the edit source_picture form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => source_pictures_path(@source_picture), :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/source_pictures/index.html.erb_spec.rb b/spec/views/source_pictures/index.html.erb_spec.rb
deleted file mode 100644 (file)
index 5f767b3..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe "source_pictures/index.html.erb" do
-  before(:each) do
-    assign(:source_pictures, [
-      stub_model(SourcePicture),
-      stub_model(SourcePicture)
-    ])
-  end
-
-  it "renders a list of source_pictures" do
-    render
-  end
-end
diff --git a/spec/views/source_pictures/new.html.erb_spec.rb b/spec/views/source_pictures/new.html.erb_spec.rb
deleted file mode 100644 (file)
index 29bf705..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "source_pictures/new.html.erb" do
-  before(:each) do
-    assign(:source_picture, stub_model(SourcePicture).as_new_record)
-  end
-
-  it "renders new source_picture form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => source_pictures_path, :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/source_pictures/show.html.erb_spec.rb b/spec/views/source_pictures/show.html.erb_spec.rb
deleted file mode 100644 (file)
index e1da0b6..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "source_pictures/show.html.erb" do
-  before(:each) do
-    @source_picture = assign(:source_picture, stub_model(SourcePicture))
-  end
-
-  it "renders attributes in <p>" do
-    render
-  end
-end
diff --git a/spec/views/speach_baloons/edit.html.erb_spec.rb b/spec/views/speach_baloons/edit.html.erb_spec.rb
deleted file mode 100644 (file)
index 2dcb015..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "speach_baloons/edit.html.erb" do
-  before(:each) do
-    @speach_baloon = assign(:speach_baloon, stub_model(SpeachBaloon))
-  end
-
-  it "renders the edit speach_baloon form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => speach_baloons_path(@speach_baloon), :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/speach_baloons/index.html.erb_spec.rb b/spec/views/speach_baloons/index.html.erb_spec.rb
deleted file mode 100644 (file)
index 5b32124..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe "speach_baloons/index.html.erb" do
-  before(:each) do
-    assign(:speach_baloons, [
-      stub_model(SpeachBaloon),
-      stub_model(SpeachBaloon)
-    ])
-  end
-
-  it "renders a list of speach_baloons" do
-    render
-  end
-end
diff --git a/spec/views/speach_baloons/new.html.erb_spec.rb b/spec/views/speach_baloons/new.html.erb_spec.rb
deleted file mode 100644 (file)
index 3f23037..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "speach_baloons/new.html.erb" do
-  before(:each) do
-    assign(:speach_baloon, stub_model(SpeachBaloon).as_new_record)
-  end
-
-  it "renders new speach_baloon form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => speach_baloons_path, :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/speach_baloons/show.html.erb_spec.rb b/spec/views/speach_baloons/show.html.erb_spec.rb
deleted file mode 100644 (file)
index c1647e3..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "speach_baloons/show.html.erb" do
-  before(:each) do
-    @speach_baloon = assign(:speach_baloon, stub_model(SpeachBaloon))
-  end
-
-  it "renders attributes in <p>" do
-    render
-  end
-end
diff --git a/spec/views/speach_templates/edit.html.erb_spec.rb b/spec/views/speach_templates/edit.html.erb_spec.rb
deleted file mode 100644 (file)
index 049a756..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "speach_templates/edit.html.erb" do
-  before(:each) do
-    @speach_template = assign(:speach_template, stub_model(SpeachTemplate))
-  end
-
-  it "renders the edit speach_template form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => speach_templates_path(@speach_template), :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/speach_templates/index.html.erb_spec.rb b/spec/views/speach_templates/index.html.erb_spec.rb
deleted file mode 100644 (file)
index 84c0e59..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe "speach_templates/index.html.erb" do
-  before(:each) do
-    assign(:speach_templates, [
-      stub_model(SpeachTemplate),
-      stub_model(SpeachTemplate)
-    ])
-  end
-
-  it "renders a list of speach_templates" do
-    render
-  end
-end
diff --git a/spec/views/speach_templates/new.html.erb_spec.rb b/spec/views/speach_templates/new.html.erb_spec.rb
deleted file mode 100644 (file)
index 0b41c70..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "speach_templates/new.html.erb" do
-  before(:each) do
-    assign(:speach_template, stub_model(SpeachTemplate).as_new_record)
-  end
-
-  it "renders new speach_template form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => speach_templates_path, :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/speach_templates/show.html.erb_spec.rb b/spec/views/speach_templates/show.html.erb_spec.rb
deleted file mode 100644 (file)
index a42cd9a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "speach_templates/show.html.erb" do
-  before(:each) do
-    @speach_template = assign(:speach_template, stub_model(SpeachTemplate))
-  end
-
-  it "renders attributes in <p>" do
-    render
-  end
-end
diff --git a/spec/views/speachbaloons/edit.html.erb_spec.rb b/spec/views/speachbaloons/edit.html.erb_spec.rb
deleted file mode 100644 (file)
index 152b1bb..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "speachbaloons/edit.html.erb" do
-  before(:each) do
-    @speachbaloon = assign(:speachbaloon, stub_model(Speachbaloon))
-  end
-
-  it "renders the edit speachbaloon form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => speachbaloons_path(@speachbaloon), :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/speachbaloons/index.html.erb_spec.rb b/spec/views/speachbaloons/index.html.erb_spec.rb
deleted file mode 100644 (file)
index e6647af..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe "speachbaloons/index.html.erb" do
-  before(:each) do
-    assign(:speachbaloons, [
-      stub_model(Speachbaloon),
-      stub_model(Speachbaloon)
-    ])
-  end
-
-  it "renders a list of speachbaloons" do
-    render
-  end
-end
diff --git a/spec/views/speachbaloons/new.html.erb_spec.rb b/spec/views/speachbaloons/new.html.erb_spec.rb
deleted file mode 100644 (file)
index 13dca10..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "speachbaloons/new.html.erb" do
-  before(:each) do
-    assign(:speachbaloon, stub_model(Speachbaloon).as_new_record)
-  end
-
-  it "renders new speachbaloon form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => speachbaloons_path, :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/speachbaloons/show.html.erb_spec.rb b/spec/views/speachbaloons/show.html.erb_spec.rb
deleted file mode 100644 (file)
index ecea8ec..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "speachbaloons/show.html.erb" do
-  before(:each) do
-    @speachbaloon = assign(:speachbaloon, stub_model(Speachbaloon))
-  end
-
-  it "renders attributes in <p>" do
-    render
-  end
-end
diff --git a/spec/views/speaches/edit.html.erb_spec.rb b/spec/views/speaches/edit.html.erb_spec.rb
deleted file mode 100644 (file)
index 6730778..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "speaches/edit.html.erb" do
-  before(:each) do
-    @speach = assign(:speach, stub_model(Speach))
-  end
-
-  it "renders the edit speach form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => speaches_path(@speach), :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/speaches/index.html.erb_spec.rb b/spec/views/speaches/index.html.erb_spec.rb
deleted file mode 100644 (file)
index 2a669b6..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe "speaches/index.html.erb" do
-  before(:each) do
-    assign(:speaches, [
-      stub_model(Speach),
-      stub_model(Speach)
-    ])
-  end
-
-  it "renders a list of speaches" do
-    render
-  end
-end
diff --git a/spec/views/speaches/new.html.erb_spec.rb b/spec/views/speaches/new.html.erb_spec.rb
deleted file mode 100644 (file)
index 65b98ec..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "speaches/new.html.erb" do
-  before(:each) do
-    assign(:speach, stub_model(Speach).as_new_record)
-  end
-
-  it "renders new speach form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => speaches_path, :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/speaches/show.html.erb_spec.rb b/spec/views/speaches/show.html.erb_spec.rb
deleted file mode 100644 (file)
index fa28c09..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "speaches/show.html.erb" do
-  before(:each) do
-    @speach = assign(:speach, stub_model(Speach))
-  end
-
-  it "renders attributes in <p>" do
-    render
-  end
-end
diff --git a/spec/views/system_pictures/edit.html.erb_spec.rb b/spec/views/system_pictures/edit.html.erb_spec.rb
deleted file mode 100644 (file)
index 0466c8d..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "system_pictures/edit.html.erb" do
-  before(:each) do
-    @system_picture = assign(:system_picture, stub_model(SystemPicture))
-  end
-
-  it "renders the edit system_picture form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => system_pictures_path(@system_picture), :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/system_pictures/index.html.erb_spec.rb b/spec/views/system_pictures/index.html.erb_spec.rb
deleted file mode 100644 (file)
index 54cad60..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe "system_pictures/index.html.erb" do
-  before(:each) do
-    assign(:system_pictures, [
-      stub_model(SystemPicture),
-      stub_model(SystemPicture)
-    ])
-  end
-
-  it "renders a list of system_pictures" do
-    render
-  end
-end
diff --git a/spec/views/system_pictures/new.html.erb_spec.rb b/spec/views/system_pictures/new.html.erb_spec.rb
deleted file mode 100644 (file)
index 09edd79..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe "system_pictures/new.html.erb" do
-  before(:each) do
-    assign(:system_picture, stub_model(SystemPicture).as_new_record)
-  end
-
-  it "renders new system_picture form" do
-    render
-
-    # Run the generator again with the --webrat flag if you want to use webrat matchers
-    assert_select "form", :action => system_pictures_path, :method => "post" do
-    end
-  end
-end
diff --git a/spec/views/system_pictures/show.html.erb_spec.rb b/spec/views/system_pictures/show.html.erb_spec.rb
deleted file mode 100644 (file)
index eebc298..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe "system_pictures/show.html.erb" do
-  before(:each) do
-    @system_picture = assign(:system_picture, stub_model(SystemPicture))
-  end
-
-  it "renders attributes in <p>" do
-    render
-  end
-end