From 3392e528d4f83ffdaf81b4d0babf5b06972e3f4a Mon Sep 17 00:00:00 2001 From: yasushiito Date: Tue, 6 Mar 2012 19:12:15 +0900 Subject: [PATCH] rename lisence to license --- LISENCE.txt => LICENSE.txt | 0 ...isences.js.coffee => common_licenses.js.coffee} | 0 .../{lisences.js.coffee => licenses.js.coffee} | 0 ...ences.js.coffee => original_licenses.js.coffee} | 0 ..._lisences.css.scss => common_licenses.css.scss} | 0 .../{lisences.css.scss => licenses.css.scss} | 0 ...isences.css.scss => original_licenses.css.scss} | 0 app/controllers/comics_controller.rb | 2 +- app/controllers/common_licenses_controller.rb | 106 ++++++++++++++ app/controllers/common_lisences_controller.rb | 106 -------------- app/controllers/home_controller.rb | 6 +- app/controllers/licenses_controller.rb | 44 ++++++ app/controllers/lisences_controller.rb | 44 ------ app/controllers/original_licenses_controller.rb | 104 ++++++++++++++ app/controllers/original_lisences_controller.rb | 104 -------------- app/controllers/original_pictures_controller.rb | 6 +- app/controllers/resource_pictures_controller.rb | 4 +- app/helpers/common_licenses_helper.rb | 2 + app/helpers/common_lisences_helper.rb | 2 - app/helpers/licenses_helper.rb | 2 + app/helpers/lisences_helper.rb | 2 - app/helpers/original_licenses_helper.rb | 2 + app/helpers/original_lisences_helper.rb | 2 - .../{common_lisence.rb => common_license.rb} | 12 +- app/models/license.rb | 7 + app/models/lisence.rb | 7 - .../{original_lisence.rb => original_license.rb} | 10 +- app/models/original_picture.rb | 2 +- app/models/resource_picture.rb | 4 +- app/views/artists/list.html.erb | 4 +- app/views/comics/top.html.erb | 2 +- .../_form.html.erb | 8 +- app/views/common_licenses/browse.html.erb | 54 +++++++ app/views/common_licenses/edit.html.erb | 6 + app/views/common_licenses/index.html.erb | 41 ++++++ app/views/common_licenses/list.html.erb | 46 ++++++ .../new.html.erb | 2 +- app/views/common_licenses/show.html.erb | 54 +++++++ app/views/common_lisences/browse.html.erb | 54 ------- app/views/common_lisences/edit.html.erb | 6 - app/views/common_lisences/index.html.erb | 41 ------ app/views/common_lisences/list.html.erb | 46 ------ app/views/common_lisences/show.html.erb | 54 ------- app/views/home/step2.html.erb | 2 +- app/views/home/step3.html.erb | 4 +- app/views/licenses/browse.html.erb | 9 ++ app/views/licenses/index.html.erb | 40 ++++++ app/views/licenses/list.html.erb | 39 +++++ app/views/licenses/show.html.erb | 5 + app/views/lisences/browse.html.erb | 9 -- app/views/lisences/index.html.erb | 40 ------ app/views/lisences/list.html.erb | 39 ----- app/views/lisences/show.html.erb | 5 - .../_form.html.erb | 8 +- app/views/original_licenses/browse.html.erb | 57 ++++++++ app/views/original_licenses/edit.html.erb | 6 + app/views/original_licenses/index.html.erb | 21 +++ app/views/original_licenses/list.html.erb | 45 ++++++ app/views/original_licenses/new.html.erb | 5 + app/views/original_licenses/show.html.erb | 58 ++++++++ app/views/original_lisences/browse.html.erb | 57 -------- app/views/original_lisences/edit.html.erb | 6 - app/views/original_lisences/index.html.erb | 21 --- app/views/original_lisences/list.html.erb | 45 ------ app/views/original_lisences/new.html.erb | 5 - app/views/original_lisences/show.html.erb | 58 -------- .../original_pictures/_artist_register.html.erb | 4 +- app/views/original_pictures/_uploader.html.erb | 4 +- app/views/original_pictures/browse.html.erb | 4 +- app/views/original_pictures/index.html.erb | 2 +- app/views/original_pictures/list.html.erb | 4 +- app/views/resource_pictures/list.html.erb | 4 +- app/views/system/browse.html.erb | 6 +- config/routes.rb | 6 +- db/migrate/20111206095746_create_artists.rb | 2 +- ...sences.rb => 20111206100750_create_licenses.rb} | 6 +- ... => 20111206105022_create_original_licenses.rb} | 6 +- .../20111206112042_create_original_pictures.rb | 2 +- .../20111206112949_create_resource_pictures.rb | 2 +- ...rb => 20111213073529_create_common_licenses.rb} | 6 +- db/schema.rb | 18 +-- db/seeds.rb | 14 +- .../controllers/common_licenses_controller_spec.rb | 157 +++++++++++++++++++++ .../controllers/common_lisences_controller_spec.rb | 157 --------------------- spec/controllers/licenses_controller_spec.rb | 157 +++++++++++++++++++++ spec/controllers/lisences_controller_spec.rb | 157 --------------------- .../original_licenses_controller_spec.rb | 157 +++++++++++++++++++++ .../original_lisences_controller_spec.rb | 157 --------------------- ...lper_spec.rb => common_licenses_helper_spec.rb} | 6 +- ...nces_helper_spec.rb => licenses_helper_spec.rb} | 6 +- ...er_spec.rb => original_licenses_helper_spec.rb} | 6 +- ...mmon_lisence_spec.rb => common_license_spec.rb} | 2 +- spec/models/{lisence_spec.rb => license_spec.rb} | 2 +- ...al_lisence_spec.rb => original_license_spec.rb} | 2 +- ...on_lisences_spec.rb => common_licenses_spec.rb} | 6 +- .../{lisences_spec.rb => licenses_spec.rb} | 6 +- ..._lisences_spec.rb => original_licenses_spec.rb} | 6 +- spec/routing/common_licenses_routing_spec.rb | 35 +++++ spec/routing/common_lisences_routing_spec.rb | 35 ----- spec/routing/licenses_routing_spec.rb | 35 +++++ spec/routing/lisences_routing_spec.rb | 35 ----- spec/routing/original_licenses_routing_spec.rb | 35 +++++ spec/routing/original_lisences_routing_spec.rb | 35 ----- spec/views/common_licenses/edit.html.erb_spec.rb | 15 ++ spec/views/common_licenses/index.html.erb_spec.rb | 14 ++ spec/views/common_licenses/new.html.erb_spec.rb | 15 ++ spec/views/common_licenses/show.html.erb_spec.rb | 11 ++ spec/views/common_lisences/edit.html.erb_spec.rb | 15 -- spec/views/common_lisences/index.html.erb_spec.rb | 14 -- spec/views/common_lisences/new.html.erb_spec.rb | 15 -- spec/views/common_lisences/show.html.erb_spec.rb | 11 -- spec/views/licenses/edit.html.erb_spec.rb | 15 ++ spec/views/licenses/index.html.erb_spec.rb | 14 ++ spec/views/licenses/new.html.erb_spec.rb | 15 ++ .../{lisences => licenses}/show.html.erb_spec.rb | 4 +- spec/views/lisences/edit.html.erb_spec.rb | 15 -- spec/views/lisences/index.html.erb_spec.rb | 14 -- spec/views/lisences/new.html.erb_spec.rb | 15 -- spec/views/original_licenses/edit.html.erb_spec.rb | 15 ++ .../views/original_licenses/index.html.erb_spec.rb | 14 ++ spec/views/original_licenses/new.html.erb_spec.rb | 15 ++ spec/views/original_licenses/show.html.erb_spec.rb | 11 ++ spec/views/original_lisences/edit.html.erb_spec.rb | 15 -- .../views/original_lisences/index.html.erb_spec.rb | 14 -- spec/views/original_lisences/new.html.erb_spec.rb | 15 -- spec/views/original_lisences/show.html.erb_spec.rb | 11 -- 126 files changed, 1589 insertions(+), 1589 deletions(-) rename LISENCE.txt => LICENSE.txt (100%) rename app/assets/javascripts/{common_lisences.js.coffee => common_licenses.js.coffee} (100%) rename app/assets/javascripts/{lisences.js.coffee => licenses.js.coffee} (100%) rename app/assets/javascripts/{original_lisences.js.coffee => original_licenses.js.coffee} (100%) rename app/assets/stylesheets/{common_lisences.css.scss => common_licenses.css.scss} (100%) rename app/assets/stylesheets/{lisences.css.scss => licenses.css.scss} (100%) rename app/assets/stylesheets/{original_lisences.css.scss => original_licenses.css.scss} (100%) create mode 100644 app/controllers/common_licenses_controller.rb delete mode 100644 app/controllers/common_lisences_controller.rb create mode 100644 app/controllers/licenses_controller.rb delete mode 100644 app/controllers/lisences_controller.rb create mode 100644 app/controllers/original_licenses_controller.rb delete mode 100644 app/controllers/original_lisences_controller.rb create mode 100644 app/helpers/common_licenses_helper.rb delete mode 100644 app/helpers/common_lisences_helper.rb create mode 100644 app/helpers/licenses_helper.rb delete mode 100644 app/helpers/lisences_helper.rb create mode 100644 app/helpers/original_licenses_helper.rb delete mode 100644 app/helpers/original_lisences_helper.rb rename app/models/{common_lisence.rb => common_license.rb} (67%) create mode 100644 app/models/license.rb delete mode 100644 app/models/lisence.rb rename app/models/{original_lisence.rb => original_license.rb} (67%) rename app/views/{common_lisences => common_licenses}/_form.html.erb (81%) create mode 100644 app/views/common_licenses/browse.html.erb create mode 100644 app/views/common_licenses/edit.html.erb create mode 100644 app/views/common_licenses/index.html.erb create mode 100644 app/views/common_licenses/list.html.erb rename app/views/{common_lisences => common_licenses}/new.html.erb (69%) create mode 100644 app/views/common_licenses/show.html.erb delete mode 100644 app/views/common_lisences/browse.html.erb delete mode 100644 app/views/common_lisences/edit.html.erb delete mode 100644 app/views/common_lisences/index.html.erb delete mode 100644 app/views/common_lisences/list.html.erb delete mode 100644 app/views/common_lisences/show.html.erb create mode 100644 app/views/licenses/browse.html.erb create mode 100644 app/views/licenses/index.html.erb create mode 100644 app/views/licenses/list.html.erb create mode 100644 app/views/licenses/show.html.erb delete mode 100644 app/views/lisences/browse.html.erb delete mode 100644 app/views/lisences/index.html.erb delete mode 100644 app/views/lisences/list.html.erb delete mode 100644 app/views/lisences/show.html.erb rename app/views/{original_lisences => original_licenses}/_form.html.erb (81%) create mode 100644 app/views/original_licenses/browse.html.erb create mode 100644 app/views/original_licenses/edit.html.erb create mode 100644 app/views/original_licenses/index.html.erb create mode 100644 app/views/original_licenses/list.html.erb create mode 100644 app/views/original_licenses/new.html.erb create mode 100644 app/views/original_licenses/show.html.erb delete mode 100644 app/views/original_lisences/browse.html.erb delete mode 100644 app/views/original_lisences/edit.html.erb delete mode 100644 app/views/original_lisences/index.html.erb delete mode 100644 app/views/original_lisences/list.html.erb delete mode 100644 app/views/original_lisences/new.html.erb delete mode 100644 app/views/original_lisences/show.html.erb rename db/migrate/{20111206100750_create_lisences.rb => 20111206100750_create_licenses.rb} (80%) rename db/migrate/{20111206105022_create_original_lisences.rb => 20111206105022_create_original_licenses.rb} (80%) rename db/migrate/{20111213073529_create_common_lisences.rb => 20111213073529_create_common_licenses.rb} (79%) create mode 100644 spec/controllers/common_licenses_controller_spec.rb delete mode 100644 spec/controllers/common_lisences_controller_spec.rb create mode 100644 spec/controllers/licenses_controller_spec.rb delete mode 100644 spec/controllers/lisences_controller_spec.rb create mode 100644 spec/controllers/original_licenses_controller_spec.rb delete mode 100644 spec/controllers/original_lisences_controller_spec.rb rename spec/helpers/{common_lisences_helper_spec.rb => common_licenses_helper_spec.rb} (74%) rename spec/helpers/{lisences_helper_spec.rb => licenses_helper_spec.rb} (77%) rename spec/helpers/{original_lisences_helper_spec.rb => original_licenses_helper_spec.rb} (73%) rename spec/models/{common_lisence_spec.rb => common_license_spec.rb} (76%) rename spec/models/{lisence_spec.rb => license_spec.rb} (80%) rename spec/models/{original_lisence_spec.rb => original_license_spec.rb} (75%) rename spec/requests/{common_lisences_spec.rb => common_licenses_spec.rb} (69%) rename spec/requests/{lisences_spec.rb => licenses_spec.rb} (74%) rename spec/requests/{original_lisences_spec.rb => original_licenses_spec.rb} (68%) create mode 100644 spec/routing/common_licenses_routing_spec.rb delete mode 100644 spec/routing/common_lisences_routing_spec.rb create mode 100644 spec/routing/licenses_routing_spec.rb delete mode 100644 spec/routing/lisences_routing_spec.rb create mode 100644 spec/routing/original_licenses_routing_spec.rb delete mode 100644 spec/routing/original_lisences_routing_spec.rb create mode 100644 spec/views/common_licenses/edit.html.erb_spec.rb create mode 100644 spec/views/common_licenses/index.html.erb_spec.rb create mode 100644 spec/views/common_licenses/new.html.erb_spec.rb create mode 100644 spec/views/common_licenses/show.html.erb_spec.rb delete mode 100644 spec/views/common_lisences/edit.html.erb_spec.rb delete mode 100644 spec/views/common_lisences/index.html.erb_spec.rb delete mode 100644 spec/views/common_lisences/new.html.erb_spec.rb delete mode 100644 spec/views/common_lisences/show.html.erb_spec.rb create mode 100644 spec/views/licenses/edit.html.erb_spec.rb create mode 100644 spec/views/licenses/index.html.erb_spec.rb create mode 100644 spec/views/licenses/new.html.erb_spec.rb rename spec/views/{lisences => licenses}/show.html.erb_spec.rb (54%) delete mode 100644 spec/views/lisences/edit.html.erb_spec.rb delete mode 100644 spec/views/lisences/index.html.erb_spec.rb delete mode 100644 spec/views/lisences/new.html.erb_spec.rb create mode 100644 spec/views/original_licenses/edit.html.erb_spec.rb create mode 100644 spec/views/original_licenses/index.html.erb_spec.rb create mode 100644 spec/views/original_licenses/new.html.erb_spec.rb create mode 100644 spec/views/original_licenses/show.html.erb_spec.rb delete mode 100644 spec/views/original_lisences/edit.html.erb_spec.rb delete mode 100644 spec/views/original_lisences/index.html.erb_spec.rb delete mode 100644 spec/views/original_lisences/new.html.erb_spec.rb delete mode 100644 spec/views/original_lisences/show.html.erb_spec.rb diff --git a/LISENCE.txt b/LICENSE.txt similarity index 100% rename from LISENCE.txt rename to LICENSE.txt diff --git a/app/assets/javascripts/common_lisences.js.coffee b/app/assets/javascripts/common_licenses.js.coffee similarity index 100% rename from app/assets/javascripts/common_lisences.js.coffee rename to app/assets/javascripts/common_licenses.js.coffee diff --git a/app/assets/javascripts/lisences.js.coffee b/app/assets/javascripts/licenses.js.coffee similarity index 100% rename from app/assets/javascripts/lisences.js.coffee rename to app/assets/javascripts/licenses.js.coffee diff --git a/app/assets/javascripts/original_lisences.js.coffee b/app/assets/javascripts/original_licenses.js.coffee similarity index 100% rename from app/assets/javascripts/original_lisences.js.coffee rename to app/assets/javascripts/original_licenses.js.coffee diff --git a/app/assets/stylesheets/common_lisences.css.scss b/app/assets/stylesheets/common_licenses.css.scss similarity index 100% rename from app/assets/stylesheets/common_lisences.css.scss rename to app/assets/stylesheets/common_licenses.css.scss diff --git a/app/assets/stylesheets/lisences.css.scss b/app/assets/stylesheets/licenses.css.scss similarity index 100% rename from app/assets/stylesheets/lisences.css.scss rename to app/assets/stylesheets/licenses.css.scss diff --git a/app/assets/stylesheets/original_lisences.css.scss b/app/assets/stylesheets/original_licenses.css.scss similarity index 100% rename from app/assets/stylesheets/original_lisences.css.scss rename to app/assets/stylesheets/original_licenses.css.scss diff --git a/app/controllers/comics_controller.rb b/app/controllers/comics_controller.rb index 3513be4c..c556b090 100644 --- a/app/controllers/comics_controller.rb +++ b/app/controllers/comics_controller.rb @@ -15,7 +15,7 @@ class ComicsController < ApplicationController :include => :author, :conditions => ['visible = 1'], :order => 'updated_at desc', :limit => 5 ) @new_pictures = OriginalPicture.find(:all, - :include => [:artist, :lisence, :resource_picture], :order => 'updated_at', :limit => 5 + :include => [:artist, :license, :resource_picture], :order => 'updated_at', :limit => 5 ) respond_to do |format| diff --git a/app/controllers/common_licenses_controller.rb b/app/controllers/common_licenses_controller.rb new file mode 100644 index 00000000..8be20392 --- /dev/null +++ b/app/controllers/common_licenses_controller.rb @@ -0,0 +1,106 @@ +class CommonLicensesController < ApplicationController + before_filter :authenticate_author!, :only => [:index, :show] + before_filter :authenticate_admin!, :only => [:list, :browse, :new, :edit, :create, :update, :destroy] + + # GET /common_licenses + # GET /common_licenses.json + def index + @common_licenses = CommonLicense.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @common_licenses } + end + end + + # GET /common_licenses/1 + # GET /common_licenses/1.json + def show + @common_license = CommonLicense.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @common_license } + end + end + + def list + @common_licenses = CommonLicense.all + + respond_to do |format| + format.html { render layout: 'system' } + format.json { render json: @common_licenses } + end + end + + def browse + @common_license = CommonLicense.find(params[:id]) + + respond_to do |format| + format.html { render layout: 'system' } + format.json { render json: @common_license } + end + end + + # GET /common_licenses/new + # GET /common_licenses/new.json + def new + @common_license = CommonLicense.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @common_license } + end + end + + # GET /common_licenses/1/edit + def edit + @common_license = CommonLicense.find(params[:id]) + end + + # POST /common_licenses + # POST /common_licenses.json + def create + @common_license = CommonLicense.new(params[:common_license]) + + respond_to do |format| + CommonLicense.transaction do + if @common_license.save_save + format.html { redirect_to :action => :browse, :id => @common_license.id, notice: 'Common license was successfully created.' } + format.json { render json: @common_license, status: :created, location: @common_license } + else + format.html { render action: "new" } + format.json { render json: @common_license.errors, status: :unprocessable_entity } + end + end + end + end + + # PUT /common_licenses/1 + # PUT /common_licenses/1.json + def update + @common_license = CommonLicense.find(params[:id]) + + respond_to do |format| + if @common_license.update_attributes(params[:common_license]) + format.html { redirect_to :action => :browse, :id => @common_license.id, notice: 'Common license was successfully updated.' } + format.json { head :ok } + else + format.html { render action: "edit" } + format.json { render json: @common_license.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /common_licenses/1 + # DELETE /common_licenses/1.json + def destroy + @common_license = CommonLicense.find(params[:id]) + @common_license.destroy + + respond_to do |format| + format.html { redirect_to common_licenses_url } + format.json { head :ok } + end + end +end diff --git a/app/controllers/common_lisences_controller.rb b/app/controllers/common_lisences_controller.rb deleted file mode 100644 index 927e460d..00000000 --- a/app/controllers/common_lisences_controller.rb +++ /dev/null @@ -1,106 +0,0 @@ -class CommonLisencesController < ApplicationController - before_filter :authenticate_author!, :only => [:index, :show] - before_filter :authenticate_admin!, :only => [:list, :browse, :new, :edit, :create, :update, :destroy] - - # GET /common_lisences - # GET /common_lisences.json - def index - @common_lisences = CommonLisence.all - - respond_to do |format| - format.html # index.html.erb - format.json { render json: @common_lisences } - end - end - - # GET /common_lisences/1 - # GET /common_lisences/1.json - def show - @common_lisence = CommonLisence.find(params[:id]) - - respond_to do |format| - format.html # show.html.erb - format.json { render json: @common_lisence } - end - end - - def list - @common_lisences = CommonLisence.all - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @common_lisences } - end - end - - def browse - @common_lisence = CommonLisence.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @common_lisence } - end - end - - # GET /common_lisences/new - # GET /common_lisences/new.json - def new - @common_lisence = CommonLisence.new - - respond_to do |format| - format.html # new.html.erb - format.json { render json: @common_lisence } - end - end - - # GET /common_lisences/1/edit - def edit - @common_lisence = CommonLisence.find(params[:id]) - end - - # POST /common_lisences - # POST /common_lisences.json - def create - @common_lisence = CommonLisence.new(params[:common_lisence]) - - respond_to do |format| - CommonLisence.transaction do - if @common_lisence.save_save - format.html { redirect_to :action => :browse, :id => @common_lisence.id, notice: 'Common lisence was successfully created.' } - format.json { render json: @common_lisence, status: :created, location: @common_lisence } - else - format.html { render action: "new" } - format.json { render json: @common_lisence.errors, status: :unprocessable_entity } - end - end - end - end - - # PUT /common_lisences/1 - # PUT /common_lisences/1.json - def update - @common_lisence = CommonLisence.find(params[:id]) - - respond_to do |format| - if @common_lisence.update_attributes(params[:common_lisence]) - format.html { redirect_to :action => :browse, :id => @common_lisence.id, notice: 'Common lisence was successfully updated.' } - format.json { head :ok } - else - format.html { render action: "edit" } - format.json { render json: @common_lisence.errors, status: :unprocessable_entity } - end - end - end - - # DELETE /common_lisences/1 - # DELETE /common_lisences/1.json - def destroy - @common_lisence = CommonLisence.find(params[:id]) - @common_lisence.destroy - - respond_to do |format| - format.html { redirect_to common_lisences_url } - format.json { head :ok } - end - end -end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index fea06eda..0b64ee9e 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -52,7 +52,7 @@ class HomeController < ApplicationController end def step3 - @artist = Artist.new :author_id => current_author.id, :name => current_author.name, :default_lisence_id => 1 + @artist = Artist.new :author_id => current_author.id, :name => current_author.name, :default_license_id => 1 end def save_step3 @@ -85,14 +85,14 @@ class HomeController < ApplicationController def picture if current_author.artist? @original_pictures = OriginalPicture.find(:all, - :include => [:artist, :lisence, :resource_picture], :conditions => ['artist_id = ?', current_author.artist.id], + :include => [:artist, :license, :resource_picture], :conditions => ['artist_id = ?', current_author.artist.id], :order => 'updated_at', :limit => 20 ) respond_to do |format| format.html # index.html.erb format.json { render :json => @original_pictures.to_json( - :include => [:resource_picture, :artist, :lisence] + :include => [:resource_picture, :artist, :license] ) } end else diff --git a/app/controllers/licenses_controller.rb b/app/controllers/licenses_controller.rb new file mode 100644 index 00000000..e5e88c82 --- /dev/null +++ b/app/controllers/licenses_controller.rb @@ -0,0 +1,44 @@ +class LicensesController < ApplicationController + before_filter :authenticate_author!, :only => [:index, :show] + before_filter :authenticate_admin!, :only => [:list, :browse] + + # GET /licenses + # GET /licenses.json + def index + @licenses = License.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @licenses } + end + end + + # GET /licenses/1 + # GET /licenses/1.json + def show + @license = License.find(params[:id]) + if @license.common_license + redirect_to :controller => 'common_licenses', :action => :browse, :id => @license.common_license.id + else + redirect_to :controller => 'original_licenses', :action => :browse, :id => @license.original_license.id + end + end + + def list + @licenses = License.all + + respond_to do |format| + format.html { render layout: 'system' } + format.json { render json: @licenses } + end + end + + def browse + @license = License.find(params[:id]) + + respond_to do |format| + format.html { render layout: 'system' } + format.json { render json: @license } + end + end +end diff --git a/app/controllers/lisences_controller.rb b/app/controllers/lisences_controller.rb deleted file mode 100644 index e40e463a..00000000 --- a/app/controllers/lisences_controller.rb +++ /dev/null @@ -1,44 +0,0 @@ -class LisencesController < ApplicationController - before_filter :authenticate_author!, :only => [:index, :show] - before_filter :authenticate_admin!, :only => [:list, :browse] - - # GET /lisences - # GET /lisences.json - def index - @lisences = Lisence.all - - respond_to do |format| - format.html # index.html.erb - format.json { render json: @lisences } - end - end - - # GET /lisences/1 - # GET /lisences/1.json - def show - @lisence = Lisence.find(params[:id]) - if @lisence.common_lisence - redirect_to :controller => 'common_lisences', :action => :browse, :id => @lisence.common_lisence.id - else - redirect_to :controller => 'original_lisences', :action => :browse, :id => @lisence.original_lisence.id - end - end - - def list - @lisences = Lisence.all - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @lisences } - end - end - - def browse - @lisence = Lisence.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @lisence } - end - end -end diff --git a/app/controllers/original_licenses_controller.rb b/app/controllers/original_licenses_controller.rb new file mode 100644 index 00000000..99878945 --- /dev/null +++ b/app/controllers/original_licenses_controller.rb @@ -0,0 +1,104 @@ +class OriginalLicensesController < ApplicationController + before_filter :authenticate_author!, :only => [:index, :show, :new, :edit, :create, :update, :destroy] + before_filter :authenticate_admin!, :only => [:list, :browse] + + # GET /original_licenses + # GET /original_licenses.json + def index + @original_licenses = OriginalLicense.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @original_licenses } + end + end + + # GET /original_licenses/1 + # GET /original_licenses/1.json + def show + @original_license = OriginalLicense.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @original_license } + end + end + + def list + @original_licenses = OriginalLicense.all + + respond_to do |format| + format.html { render layout: 'system' } + format.json { render json: @original_licenses } + end + end + + def browse + @original_license = OriginalLicense.find(params[:id]) + + respond_to do |format| + format.html { render layout: 'system' } + format.json { render json: @original_license } + end + end + + # GET /original_licenses/new + # GET /original_licenses/new.json + def new + @original_license = OriginalLicense.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @original_license } + end + end + + # GET /original_licenses/1/edit + def edit + @original_license = OriginalLicense.find(params[:id]) + end + + # POST /original_licenses + # POST /original_licenses.json + def create + @original_license = OriginalLicense.new(params[:original_license]) + @original_license.artist_id = current_author.artist.id + respond_to do |format| + if @original_license.save_save + format.html { redirect_to @original_license, notice: 'Original license was successfully created.' } + format.json { render json: @original_license, status: :created, location: @original_license } + else + format.html { render action: "new" } + format.json { render json: @original_license.errors, status: :unprocessable_entity } + end + end + end + + # PUT /original_licenses/1 + # PUT /original_licenses/1.json + def update + @original_license = OriginalLicense.find(params[:id]) + + respond_to do |format| + if @original_license.update_attributes(params[:original_license]) + format.html { redirect_to @original_license, notice: 'Original license was successfully updated.' } + format.json { head :ok } + else + format.html { render action: "edit" } + format.json { render json: @original_license.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /original_licenses/1 + # DELETE /original_licenses/1.json + def destroy + @original_license = OriginalLicense.find(params[:id]) + @original_license.destroy + + respond_to do |format| + format.html { redirect_to original_licenses_url } + format.json { head :ok } + end + end +end diff --git a/app/controllers/original_lisences_controller.rb b/app/controllers/original_lisences_controller.rb deleted file mode 100644 index c1a2fd22..00000000 --- a/app/controllers/original_lisences_controller.rb +++ /dev/null @@ -1,104 +0,0 @@ -class OriginalLisencesController < ApplicationController - before_filter :authenticate_author!, :only => [:index, :show, :new, :edit, :create, :update, :destroy] - before_filter :authenticate_admin!, :only => [:list, :browse] - - # GET /original_lisences - # GET /original_lisences.json - def index - @original_lisences = OriginalLisence.all - - respond_to do |format| - format.html # index.html.erb - format.json { render json: @original_lisences } - end - end - - # GET /original_lisences/1 - # GET /original_lisences/1.json - def show - @original_lisence = OriginalLisence.find(params[:id]) - - respond_to do |format| - format.html # show.html.erb - format.json { render json: @original_lisence } - end - end - - def list - @original_lisences = OriginalLisence.all - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @original_lisences } - end - end - - def browse - @original_lisence = OriginalLisence.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @original_lisence } - end - end - - # GET /original_lisences/new - # GET /original_lisences/new.json - def new - @original_lisence = OriginalLisence.new - - respond_to do |format| - format.html # new.html.erb - format.json { render json: @original_lisence } - end - end - - # GET /original_lisences/1/edit - def edit - @original_lisence = OriginalLisence.find(params[:id]) - end - - # POST /original_lisences - # POST /original_lisences.json - def create - @original_lisence = OriginalLisence.new(params[:original_lisence]) - @original_lisence.artist_id = current_author.artist.id - respond_to do |format| - if @original_lisence.save_save - format.html { redirect_to @original_lisence, notice: 'Original lisence was successfully created.' } - format.json { render json: @original_lisence, status: :created, location: @original_lisence } - else - format.html { render action: "new" } - format.json { render json: @original_lisence.errors, status: :unprocessable_entity } - end - end - end - - # PUT /original_lisences/1 - # PUT /original_lisences/1.json - def update - @original_lisence = OriginalLisence.find(params[:id]) - - respond_to do |format| - if @original_lisence.update_attributes(params[:original_lisence]) - format.html { redirect_to @original_lisence, notice: 'Original lisence was successfully updated.' } - format.json { head :ok } - else - format.html { render action: "edit" } - format.json { render json: @original_lisence.errors, status: :unprocessable_entity } - end - end - end - - # DELETE /original_lisences/1 - # DELETE /original_lisences/1.json - def destroy - @original_lisence = OriginalLisence.find(params[:id]) - @original_lisence.destroy - - respond_to do |format| - format.html { redirect_to original_lisences_url } - format.json { head :ok } - end - end -end diff --git a/app/controllers/original_pictures_controller.rb b/app/controllers/original_pictures_controller.rb index 99fcb200..85c77df0 100644 --- a/app/controllers/original_pictures_controller.rb +++ b/app/controllers/original_pictures_controller.rb @@ -36,13 +36,13 @@ class OriginalPicturesController < ApplicationController # GET /original_pictures.json def index @original_pictures = OriginalPicture.find(:all, - :include => [:artist, :lisence, :resource_picture], :order => 'updated_at', :limit => 20 + :include => [:artist, :license, :resource_picture], :order => 'updated_at', :limit => 20 ) respond_to do |format| format.html # index.html.erb format.json { render :json => @original_pictures.to_json( - :include => [:resource_picture, :artist, :lisence] + :include => [:resource_picture, :artist, :license] ) } end end @@ -123,7 +123,7 @@ class OriginalPicturesController < ApplicationController @original_picture = OriginalPicture.new img = set_image params @original_picture.artist_id = current_author.artist.id - @original_picture.lisence_id = current_author.artist.default_lisence_id + @original_picture.license_id = current_author.artist.default_license_id respond_to do |format| OriginalPicture.transaction do diff --git a/app/controllers/resource_pictures_controller.rb b/app/controllers/resource_pictures_controller.rb index 0ab406b1..dd6879e6 100644 --- a/app/controllers/resource_pictures_controller.rb +++ b/app/controllers/resource_pictures_controller.rb @@ -6,13 +6,13 @@ class ResourcePicturesController < ApplicationController # GET /resource_pictures.json def index @resource_pictures = ResourcePicture.find(:all, - :include => {:original_picture => [:artist, :lisence]}, :order => 'updated_at', :limit => 20 + :include => {:original_picture => [:artist, :license]}, :order => 'updated_at', :limit => 20 ) respond_to do |format| format.html # index.html.erb format.json { render :json => @resource_pictures.to_json( - :include => [:original_picture, :artist, :lisence] + :include => [:original_picture, :artist, :license] ) } end end diff --git a/app/helpers/common_licenses_helper.rb b/app/helpers/common_licenses_helper.rb new file mode 100644 index 00000000..5ee58dd1 --- /dev/null +++ b/app/helpers/common_licenses_helper.rb @@ -0,0 +1,2 @@ +module CommonLicensesHelper +end diff --git a/app/helpers/common_lisences_helper.rb b/app/helpers/common_lisences_helper.rb deleted file mode 100644 index 7f959d25..00000000 --- a/app/helpers/common_lisences_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module CommonLisencesHelper -end diff --git a/app/helpers/licenses_helper.rb b/app/helpers/licenses_helper.rb new file mode 100644 index 00000000..8937fda9 --- /dev/null +++ b/app/helpers/licenses_helper.rb @@ -0,0 +1,2 @@ +module LicensesHelper +end diff --git a/app/helpers/lisences_helper.rb b/app/helpers/lisences_helper.rb deleted file mode 100644 index 5519b997..00000000 --- a/app/helpers/lisences_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module LisencesHelper -end diff --git a/app/helpers/original_licenses_helper.rb b/app/helpers/original_licenses_helper.rb new file mode 100644 index 00000000..1d0d773d --- /dev/null +++ b/app/helpers/original_licenses_helper.rb @@ -0,0 +1,2 @@ +module OriginalLicensesHelper +end diff --git a/app/helpers/original_lisences_helper.rb b/app/helpers/original_lisences_helper.rb deleted file mode 100644 index 1fe11c86..00000000 --- a/app/helpers/original_lisences_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module OriginalLisencesHelper -end diff --git a/app/models/common_lisence.rb b/app/models/common_license.rb similarity index 67% rename from app/models/common_lisence.rb rename to app/models/common_license.rb index 8a94de97..834ee882 100644 --- a/app/models/common_lisence.rb +++ b/app/models/common_license.rb @@ -1,16 +1,16 @@ -class CommonLisence < ActiveRecord::Base - belongs_to :lisence +class CommonLicense < ActiveRecord::Base + belongs_to :license def save_save - lisence = Lisence.new( { + license = License.new( { :name => self.name, :url => self.url, :cc_by => self.cc_by, :cc_sa => self.cc_sa, :cc_nd => self.cc_nd, :cc_nc => self.cc_nc, :no_resize => self.no_resize, :no_flip => self.no_flip, :no_convert => self.no_convert, :keep_aspect_ratio => self.keep_aspect_ratio }) - self.lisence_id = 0 + self.license_id = 0 res = self.save return false unless res - return false unless lisence.save - self.lisence_id = lisence.id + return false unless license.save + self.license_id = license.id res = self.save res end diff --git a/app/models/license.rb b/app/models/license.rb new file mode 100644 index 00000000..668f289c --- /dev/null +++ b/app/models/license.rb @@ -0,0 +1,7 @@ +class License < ActiveRecord::Base + has_one :original_license + has_one :common_license + accepts_nested_attributes_for :original_license + accepts_nested_attributes_for :common_license + +end diff --git a/app/models/lisence.rb b/app/models/lisence.rb deleted file mode 100644 index d4ed4356..00000000 --- a/app/models/lisence.rb +++ /dev/null @@ -1,7 +0,0 @@ -class Lisence < ActiveRecord::Base - has_one :original_lisence - has_one :common_lisence - accepts_nested_attributes_for :original_lisence - accepts_nested_attributes_for :common_lisence - -end diff --git a/app/models/original_lisence.rb b/app/models/original_license.rb similarity index 67% rename from app/models/original_lisence.rb rename to app/models/original_license.rb index 75f2f0e2..ebc0b410 100644 --- a/app/models/original_lisence.rb +++ b/app/models/original_license.rb @@ -1,14 +1,14 @@ -class OriginalLisence < ActiveRecord::Base - belongs_to :lisence +class OriginalLicense < ActiveRecord::Base + belongs_to :license def save_save - lisence = Lisence.new( { + license = License.new( { :name => self.name, :url => self.url, :cc_by => self.cc_by, :cc_sa => self.cc_sa, :cc_nd => self.cc_nd, :cc_nc => self.cc_nc, :no_resize => self.no_resize, :no_flip => self.no_flip, :no_convert => self.no_convert, :keep_aspect_ratio => self.keep_aspect_ratio }) - return false unless lisence.save - self.lisence_id = lisence.id + return false unless license.save + self.license_id = license.id res = self.save res end diff --git a/app/models/original_picture.rb b/app/models/original_picture.rb index dacbb6ff..47ec7c8f 100644 --- a/app/models/original_picture.rb +++ b/app/models/original_picture.rb @@ -1,6 +1,6 @@ class OriginalPicture < ActiveRecord::Base belongs_to :artist - belongs_to :lisence + belongs_to :license has_one :resource_picture before_destroy :destroy_with_file diff --git a/app/models/resource_picture.rb b/app/models/resource_picture.rb index 53abc643..06f65ca2 100644 --- a/app/models/resource_picture.rb +++ b/app/models/resource_picture.rb @@ -1,6 +1,6 @@ class ResourcePicture < ActiveRecord::Base belongs_to :artist - belongs_to :lisence + belongs_to :license has_many :panel_pictures belongs_to :original_picture @@ -79,7 +79,7 @@ class ResourcePicture < ActiveRecord::Base width: original_picture.width, height: original_picture.height, ext: original_picture.ext, filesize: original_picture.filesize, original_picture_id: original_picture.id, artist_id: original_picture.artist_id, - lisence_id: original_picture.lisence_id + license_id: original_picture.license_id ) res = if resource_picture.save if resource_picture.store(img) diff --git a/app/views/artists/list.html.erb b/app/views/artists/list.html.erb index 1ffd5d30..dcb90be7 100644 --- a/app/views/artists/list.html.erb +++ b/app/views/artists/list.html.erb @@ -7,7 +7,7 @@ name homepage_url api_url - default_lisence + default_license crowled_at author_id created_at @@ -21,7 +21,7 @@ <%= h artist.name %> <%= h artist.homepage_url %> <%= h artist.api_url %> - <%= link_to artist.default_lisence_id, :controller => 'lisences', :action => :browse, :id => artist.default_lisence_id %> + <%= link_to artist.default_license_id, :controller => 'licenses', :action => :browse, :id => artist.default_license_id %> <%= artist.crowled_at %> <%= link_to artist.author_id, :controller => 'authors', :action => :browse, :id => artist.author_id %> <%= artist.created_at %> diff --git a/app/views/comics/top.html.erb b/app/views/comics/top.html.erb index df6393a2..6b202543 100644 --- a/app/views/comics/top.html.erb +++ b/app/views/comics/top.html.erb @@ -39,4 +39,4 @@ <% end %> <%= link_to "もっと見る", original_pictures_path %>

ライセンス

-<%= link_to "lisences", lisences_path %> +<%= link_to "licenses", licenses_path %> diff --git a/app/views/common_lisences/_form.html.erb b/app/views/common_licenses/_form.html.erb similarity index 81% rename from app/views/common_lisences/_form.html.erb rename to app/views/common_licenses/_form.html.erb index 01c77e3c..dfc7d1ce 100644 --- a/app/views/common_lisences/_form.html.erb +++ b/app/views/common_licenses/_form.html.erb @@ -1,10 +1,10 @@ -<%= form_for(@common_lisence) do |f| %> - <% if @common_lisence.errors.any? %> +<%= form_for(@common_license) do |f| %> + <% if @common_license.errors.any? %>
-

<%= pluralize(@common_lisence.errors.count, "error") %> prohibited this common_lisence from being saved:

+

<%= pluralize(@common_license.errors.count, "error") %> prohibited this common_license from being saved:

diff --git a/app/views/common_licenses/browse.html.erb b/app/views/common_licenses/browse.html.erb new file mode 100644 index 00000000..5a45da86 --- /dev/null +++ b/app/views/common_licenses/browse.html.erb @@ -0,0 +1,54 @@ +

<%= notice %>

+ +

+ name: + <%= h @common_license.name %> +

+ +

+ url: + <%= h @common_license.url %> +

+ +

+ cc_by: + <%= @common_license.cc_by %> +

+ +

+ cc_sa: + <%= @common_license.cc_sa %> +

+ +

+ cc_nd: + <%= @common_license.cc_nd %> +

+ +

+ cc_nc: + <%= @common_license.cc_nc %> +

+ +

+ no_resize: + <%= @common_license.no_resize %> +

+ +

+ no_flip: + <%= @common_license.no_flip %> +

+ +

+ no_convert: + <%= @common_license.no_convert %> +

+ +

+ keep_aspect_ratio: + <%= @common_license.keep_aspect_ratio %> +

+ +<%= link_to 'Edit', edit_common_license_path(@common_license) %> | +<%= link_to 'Back', :action => :list %> diff --git a/app/views/common_licenses/edit.html.erb b/app/views/common_licenses/edit.html.erb new file mode 100644 index 00000000..ccb1d081 --- /dev/null +++ b/app/views/common_licenses/edit.html.erb @@ -0,0 +1,6 @@ +

Editing common_license

+ +<%= render 'form' %> + +<%= link_to 'Show', :controller => 'common_licenses', :action => :browse, :id => @common_license.id %> | +<%= link_to 'Back', :action => :list %> diff --git a/app/views/common_licenses/index.html.erb b/app/views/common_licenses/index.html.erb new file mode 100644 index 00000000..7f1e9050 --- /dev/null +++ b/app/views/common_licenses/index.html.erb @@ -0,0 +1,41 @@ +

Listing common_licenses

+ + + + + + + + + + + + + + + + + + +<% @common_licenses.each do |common_license| %> + + + + + + + + + + + + + + + +<% end %> +
nameurlcc_bycc_sacc_ndcc_ncno_resizeno_flipno_convertkeep_aspect_ratio
<%= h common_license.name %><%= h common_license.url %><%= common_license.cc_by %><%= common_license.cc_sa %><%= common_license.cc_nd %><%= common_license.cc_nc %><%= common_license.no_resize %><%= common_license.no_flip %><%= common_license.no_convert %><%= common_license.keep_aspect_ratio %><%= link_to 'Show', common_license %><%= link_to 'Edit', edit_common_license_path(common_license) %><%= link_to 'Destroy', common_license, confirm: 'Are you sure?', method: :delete %>
+ +
+ +<%= link_to 'New Common_license', new_common_license_path %> diff --git a/app/views/common_licenses/list.html.erb b/app/views/common_licenses/list.html.erb new file mode 100644 index 00000000..607c09e8 --- /dev/null +++ b/app/views/common_licenses/list.html.erb @@ -0,0 +1,46 @@ +

Listing common_licenses

+ + + + + + + + + + + + + + + + + + + + + +<% @common_licenses.each do |common_license| %> + + + + + + + + + + + + + + + + + +<% end %> +
idlicense_idnameurlcc_bycc_sacc_ndcc_ncno_resizeno_flipno_convertkeep_aspect_ratiocreated_atupdated_at
<%= link_to common_license.id, :action => :browse, :id => common_license.id %><%= h common_license.name %><%= h common_license.url %><%= common_license.cc_by %><%= common_license.cc_sa %><%= common_license.cc_nd %><%= common_license.cc_nc %><%= common_license.no_resize %><%= common_license.no_flip %><%= common_license.no_convert %><%= common_license.keep_aspect_ratio %><%= common_license.created_at %><%= common_license.updated_at %><%= link_to 'Edit', edit_common_license_path(common_license) %><%= link_to 'Destroy', common_license, confirm: 'Are you sure?', method: :delete %>
+ +
+ +<%= link_to 'New Common_license', new_common_license_path %> diff --git a/app/views/common_lisences/new.html.erb b/app/views/common_licenses/new.html.erb similarity index 69% rename from app/views/common_lisences/new.html.erb rename to app/views/common_licenses/new.html.erb index 739bf498..e5ed5558 100644 --- a/app/views/common_lisences/new.html.erb +++ b/app/views/common_licenses/new.html.erb @@ -1,4 +1,4 @@ -

New common_lisence

+

New common_license

<%= render 'form' %> diff --git a/app/views/common_licenses/show.html.erb b/app/views/common_licenses/show.html.erb new file mode 100644 index 00000000..aec2f420 --- /dev/null +++ b/app/views/common_licenses/show.html.erb @@ -0,0 +1,54 @@ +

<%= notice %>

+ +

+ name: + <%= h @common_license.name %> +

+ +

+ url: + <%= h @common_license.url %> +

+ +

+ cc_by: + <%= @common_license.cc_by %> +

+ +

+ cc_sa: + <%= @common_license.cc_sa %> +

+ +

+ cc_nd: + <%= @common_license.cc_nd %> +

+ +

+ cc_nc: + <%= @common_license.cc_nc %> +

+ +

+ no_resize: + <%= @common_license.no_resize %> +

+ +

+ no_flip: + <%= @common_license.no_flip %> +

+ +

+ no_convert: + <%= @common_license.no_convert %> +

+ +

+ keep_aspect_ratio: + <%= @common_license.keep_aspect_ratio %> +

+ +<%= link_to 'Edit', edit_common_license_path(@common_license) %> | +<%= link_to 'Back', licenses_path %> diff --git a/app/views/common_lisences/browse.html.erb b/app/views/common_lisences/browse.html.erb deleted file mode 100644 index af229c18..00000000 --- a/app/views/common_lisences/browse.html.erb +++ /dev/null @@ -1,54 +0,0 @@ -

<%= notice %>

- -

- name: - <%= h @common_lisence.name %> -

- -

- url: - <%= h @common_lisence.url %> -

- -

- cc_by: - <%= @common_lisence.cc_by %> -

- -

- cc_sa: - <%= @common_lisence.cc_sa %> -

- -

- cc_nd: - <%= @common_lisence.cc_nd %> -

- -

- cc_nc: - <%= @common_lisence.cc_nc %> -

- -

- no_resize: - <%= @common_lisence.no_resize %> -

- -

- no_flip: - <%= @common_lisence.no_flip %> -

- -

- no_convert: - <%= @common_lisence.no_convert %> -

- -

- keep_aspect_ratio: - <%= @common_lisence.keep_aspect_ratio %> -

- -<%= link_to 'Edit', edit_common_lisence_path(@common_lisence) %> | -<%= link_to 'Back', :action => :list %> diff --git a/app/views/common_lisences/edit.html.erb b/app/views/common_lisences/edit.html.erb deleted file mode 100644 index 7c642d1f..00000000 --- a/app/views/common_lisences/edit.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -

Editing common_lisence

- -<%= render 'form' %> - -<%= link_to 'Show', :controller => 'common_lisences', :action => :browse, :id => @common_lisence.id %> | -<%= link_to 'Back', :action => :list %> diff --git a/app/views/common_lisences/index.html.erb b/app/views/common_lisences/index.html.erb deleted file mode 100644 index 3170468e..00000000 --- a/app/views/common_lisences/index.html.erb +++ /dev/null @@ -1,41 +0,0 @@ -

Listing common_lisences

- - - - - - - - - - - - - - - - - - -<% @common_lisences.each do |common_lisence| %> - - - - - - - - - - - - - - - -<% end %> -
nameurlcc_bycc_sacc_ndcc_ncno_resizeno_flipno_convertkeep_aspect_ratio
<%= h common_lisence.name %><%= h common_lisence.url %><%= common_lisence.cc_by %><%= common_lisence.cc_sa %><%= common_lisence.cc_nd %><%= common_lisence.cc_nc %><%= common_lisence.no_resize %><%= common_lisence.no_flip %><%= common_lisence.no_convert %><%= common_lisence.keep_aspect_ratio %><%= link_to 'Show', common_lisence %><%= link_to 'Edit', edit_common_lisence_path(common_lisence) %><%= link_to 'Destroy', common_lisence, confirm: 'Are you sure?', method: :delete %>
- -
- -<%= link_to 'New Common_lisence', new_common_lisence_path %> diff --git a/app/views/common_lisences/list.html.erb b/app/views/common_lisences/list.html.erb deleted file mode 100644 index f1f475ba..00000000 --- a/app/views/common_lisences/list.html.erb +++ /dev/null @@ -1,46 +0,0 @@ -

Listing common_lisences

- - - - - - - - - - - - - - - - - - - - - -<% @common_lisences.each do |common_lisence| %> - - - - - - - - - - - - - - - - - -<% end %> -
idlisence_idnameurlcc_bycc_sacc_ndcc_ncno_resizeno_flipno_convertkeep_aspect_ratiocreated_atupdated_at
<%= link_to common_lisence.id, :action => :browse, :id => common_lisence.id %><%= h common_lisence.name %><%= h common_lisence.url %><%= common_lisence.cc_by %><%= common_lisence.cc_sa %><%= common_lisence.cc_nd %><%= common_lisence.cc_nc %><%= common_lisence.no_resize %><%= common_lisence.no_flip %><%= common_lisence.no_convert %><%= common_lisence.keep_aspect_ratio %><%= common_lisence.created_at %><%= common_lisence.updated_at %><%= link_to 'Edit', edit_common_lisence_path(common_lisence) %><%= link_to 'Destroy', common_lisence, confirm: 'Are you sure?', method: :delete %>
- -
- -<%= link_to 'New Common_lisence', new_common_lisence_path %> diff --git a/app/views/common_lisences/show.html.erb b/app/views/common_lisences/show.html.erb deleted file mode 100644 index c1f96237..00000000 --- a/app/views/common_lisences/show.html.erb +++ /dev/null @@ -1,54 +0,0 @@ -

<%= notice %>

- -

- name: - <%= h @common_lisence.name %> -

- -

- url: - <%= h @common_lisence.url %> -

- -

- cc_by: - <%= @common_lisence.cc_by %> -

- -

- cc_sa: - <%= @common_lisence.cc_sa %> -

- -

- cc_nd: - <%= @common_lisence.cc_nd %> -

- -

- cc_nc: - <%= @common_lisence.cc_nc %> -

- -

- no_resize: - <%= @common_lisence.no_resize %> -

- -

- no_flip: - <%= @common_lisence.no_flip %> -

- -

- no_convert: - <%= @common_lisence.no_convert %> -

- -

- keep_aspect_ratio: - <%= @common_lisence.keep_aspect_ratio %> -

- -<%= link_to 'Edit', edit_common_lisence_path(@common_lisence) %> | -<%= link_to 'Back', lisences_path %> diff --git a/app/views/home/step2.html.erb b/app/views/home/step2.html.erb index 70281cbc..8b10327c 100644 --- a/app/views/home/step2.html.erb +++ b/app/views/home/step2.html.erb @@ -6,7 +6,7 @@ <%= form_for(:author, :url => {:controller => '/home', :action => :save_step2}) do |f| %> <% if @author.errors.any? %>
-

<%= pluralize(@author.errors.count, "error") %> prohibited this original_lisence from being saved:

+

<%= pluralize(@author.errors.count, "error") %> prohibited this original_license from being saved:

    <% @author.errors.full_messages.each do |msg| %> diff --git a/app/views/home/step3.html.erb b/app/views/home/step3.html.erb index 13a37a1c..73a0bd81 100644 --- a/app/views/home/step3.html.erb +++ b/app/views/home/step3.html.erb @@ -20,8 +20,8 @@ <%= f.text_field :name %>

    素材をアップロードするときのデフォルトライセンスを選択します。

    - <%= f.label :default_lisence_id %>
    - <%= f.select :default_lisence_id, Lisence.all.map {|l| [l.name, l.id] }, :html => {:selected => @artist.default_lisence_id} %> + <%= f.label :default_license_id %>
    + <%= f.select :default_license_id, License.all.map {|l| [l.name, l.id] }, :html => {:selected => @artist.default_license_id} %> <%= f.hidden_field :author_id, :value => @artist.author_id %>
diff --git a/app/views/licenses/browse.html.erb b/app/views/licenses/browse.html.erb new file mode 100644 index 00000000..c00a645e --- /dev/null +++ b/app/views/licenses/browse.html.erb @@ -0,0 +1,9 @@ +
+<% if @license.common_license -%> + <%= link_to 'to common_licenses', :controller => 'common_licenses', :action => :browse, :id => @license.common_license.id %> +<% else -%> + <%= link_to 'to original_licenses', :controller => 'original_licenses', :action => :browse, :id => @license.original_license.id %> +<% end -%> +
+ +<%= link_to 'Back', :action => :list %> diff --git a/app/views/licenses/index.html.erb b/app/views/licenses/index.html.erb new file mode 100644 index 00000000..7df7b82d --- /dev/null +++ b/app/views/licenses/index.html.erb @@ -0,0 +1,40 @@ +

Listing licenses

+ + + + + + + + + + + + + + + + +<% @licenses.each do |license| %> + + + + + + + + + + + + + +<% end -%> +
nameurlcc_bycc_sacc_ndcc_ncno_resizeno_flipno_convertkeep_aspect_ratio
<%= h license.name %><%= h license.url %><%= license.cc_by %><%= license.cc_sa %><%= license.cc_nd %><%= license.cc_nc %><%= license.no_resize %><%= license.no_flip %><%= license.no_convert %><%= license.keep_aspect_ratio %> + <% if license.common_license -%> + <%= link_to 'Show', license.common_license %> + <% else -%> + <%= link_to 'Show', license.original_license %> + <% end -%> +
+<%= link_to 'new original license', new_original_license_path %> diff --git a/app/views/licenses/list.html.erb b/app/views/licenses/list.html.erb new file mode 100644 index 00000000..cdafef5f --- /dev/null +++ b/app/views/licenses/list.html.erb @@ -0,0 +1,39 @@ +

Listing licenses

+ + + + + + + + + + + + + + + + + + + +<% @licenses.each do |license| %> + + + + + + + + + + + + + + + +<% end -%> +
idnameurlcc_bycc_sacc_ndcc_ncno_resizeno_flipno_convertkeep_aspect_ratiocreated_atupdated_at
<%= link_to license.id, :action => :browse, :id => license.id %><%= h license.name %><%= h license.url %><%= license.cc_by %><%= license.cc_sa %><%= license.cc_nd %><%= license.cc_nc %><%= license.no_resize %><%= license.no_flip %><%= license.no_convert %><%= license.keep_aspect_ratio %><%= license.created_at %><%= license.updated_at %>
+<%= link_to 'new original license', new_original_license_path %> diff --git a/app/views/licenses/show.html.erb b/app/views/licenses/show.html.erb new file mode 100644 index 00000000..afa67b57 --- /dev/null +++ b/app/views/licenses/show.html.erb @@ -0,0 +1,5 @@ +

<%= notice %>

+ + +<%= link_to 'Edit', edit_license_path(@license) %> | +<%= link_to 'Back', licenses_path %> diff --git a/app/views/lisences/browse.html.erb b/app/views/lisences/browse.html.erb deleted file mode 100644 index a95e4fce..00000000 --- a/app/views/lisences/browse.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -
-<% if @lisence.common_lisence -%> - <%= link_to 'to common_lisences', :controller => 'common_lisences', :action => :browse, :id => @lisence.common_lisence.id %> -<% else -%> - <%= link_to 'to original_lisences', :controller => 'original_lisences', :action => :browse, :id => @lisence.original_lisence.id %> -<% end -%> -
- -<%= link_to 'Back', :action => :list %> diff --git a/app/views/lisences/index.html.erb b/app/views/lisences/index.html.erb deleted file mode 100644 index 5936046c..00000000 --- a/app/views/lisences/index.html.erb +++ /dev/null @@ -1,40 +0,0 @@ -

Listing lisences

- - - - - - - - - - - - - - - - -<% @lisences.each do |lisence| %> - - - - - - - - - - - - - -<% end -%> -
nameurlcc_bycc_sacc_ndcc_ncno_resizeno_flipno_convertkeep_aspect_ratio
<%= h lisence.name %><%= h lisence.url %><%= lisence.cc_by %><%= lisence.cc_sa %><%= lisence.cc_nd %><%= lisence.cc_nc %><%= lisence.no_resize %><%= lisence.no_flip %><%= lisence.no_convert %><%= lisence.keep_aspect_ratio %> - <% if lisence.common_lisence -%> - <%= link_to 'Show', lisence.common_lisence %> - <% else -%> - <%= link_to 'Show', lisence.original_lisence %> - <% end -%> -
-<%= link_to 'new original lisence', new_original_lisence_path %> diff --git a/app/views/lisences/list.html.erb b/app/views/lisences/list.html.erb deleted file mode 100644 index 6d218350..00000000 --- a/app/views/lisences/list.html.erb +++ /dev/null @@ -1,39 +0,0 @@ -

Listing lisences

- - - - - - - - - - - - - - - - - - - -<% @lisences.each do |lisence| %> - - - - - - - - - - - - - - - -<% end -%> -
idnameurlcc_bycc_sacc_ndcc_ncno_resizeno_flipno_convertkeep_aspect_ratiocreated_atupdated_at
<%= link_to lisence.id, :action => :browse, :id => lisence.id %><%= h lisence.name %><%= h lisence.url %><%= lisence.cc_by %><%= lisence.cc_sa %><%= lisence.cc_nd %><%= lisence.cc_nc %><%= lisence.no_resize %><%= lisence.no_flip %><%= lisence.no_convert %><%= lisence.keep_aspect_ratio %><%= lisence.created_at %><%= lisence.updated_at %>
-<%= link_to 'new original lisence', new_original_lisence_path %> diff --git a/app/views/lisences/show.html.erb b/app/views/lisences/show.html.erb deleted file mode 100644 index fd82a9b0..00000000 --- a/app/views/lisences/show.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -

<%= notice %>

- - -<%= link_to 'Edit', edit_lisence_path(@lisence) %> | -<%= link_to 'Back', lisences_path %> diff --git a/app/views/original_lisences/_form.html.erb b/app/views/original_licenses/_form.html.erb similarity index 81% rename from app/views/original_lisences/_form.html.erb rename to app/views/original_licenses/_form.html.erb index efe93bb0..c593f31d 100644 --- a/app/views/original_lisences/_form.html.erb +++ b/app/views/original_licenses/_form.html.erb @@ -1,10 +1,10 @@ -<%= form_for(@original_lisence) do |f| %> - <% if @original_lisence.errors.any? %> +<%= form_for(@original_license) do |f| %> + <% if @original_license.errors.any? %>
-

<%= pluralize(@original_lisence.errors.count, "error") %> prohibited this original_lisence from being saved:

+

<%= pluralize(@original_license.errors.count, "error") %> prohibited this original_license from being saved:

    - <% @original_lisence.errors.full_messages.each do |msg| %> + <% @original_license.errors.full_messages.each do |msg| %>
  • <%= msg %>
  • <% end %>
diff --git a/app/views/original_licenses/browse.html.erb b/app/views/original_licenses/browse.html.erb new file mode 100644 index 00000000..4b668347 --- /dev/null +++ b/app/views/original_licenses/browse.html.erb @@ -0,0 +1,57 @@ +

<%= notice %>

+ +

+ name: + <%= h @original_license.name %> +

+ +

+ url: + <%= h @original_license.url %> +

+ +

+ artist: + <%= @original_license.artist_id %> +

+

+ cc_by: + <%= @original_license.cc_by %> +

+ +

+ cc_sa: + <%= @original_license.cc_sa %> +

+ +

+ cc_nd: + <%= @original_license.cc_nd %> +

+ +

+ cc_nc: + <%= @original_license.cc_nc %> +

+ +

+ no_resize: + <%= @original_license.no_resize %> +

+ +

+ no_flip: + <%= @original_license.no_flip %> +

+ +

+ no_convert: + <%= @original_license.no_convert %> +

+ +

+ keep_aspect_ratio: + <%= @original_license.keep_aspect_ratio %> +

+ +<%= link_to 'Back', :action => :list %> diff --git a/app/views/original_licenses/edit.html.erb b/app/views/original_licenses/edit.html.erb new file mode 100644 index 00000000..3888c3f2 --- /dev/null +++ b/app/views/original_licenses/edit.html.erb @@ -0,0 +1,6 @@ +

Editing original_license

+ +<%= render 'form' %> + +<%= link_to 'Show', @original_license %> | +<%= link_to 'Back', licenses_path %> diff --git a/app/views/original_licenses/index.html.erb b/app/views/original_licenses/index.html.erb new file mode 100644 index 00000000..4ebdbc7f --- /dev/null +++ b/app/views/original_licenses/index.html.erb @@ -0,0 +1,21 @@ +

Listing original_licenses

+ + + + + + + + +<% @original_licenses.each do |original_license| %> + + + + + +<% end %> +
<%= link_to 'Show', original_license %><%= link_to 'Edit', edit_original_license_path(original_license) %><%= link_to 'Destroy', original_license, confirm: 'Are you sure?', method: :delete %>
+ +
+ +<%= link_to 'New Original license', new_original_license_path %> diff --git a/app/views/original_licenses/list.html.erb b/app/views/original_licenses/list.html.erb new file mode 100644 index 00000000..4e5f8767 --- /dev/null +++ b/app/views/original_licenses/list.html.erb @@ -0,0 +1,45 @@ +

Listing original_licenses

+ + + + + + + + + + + + + + + + + + + + + + +<% @original_licenses.each do |original_license| %> + + + + + + + + + + + + + + + + + + +<% end %> +
idartist_idlicense_idnameurlcc_bycc_sacc_ndcc_ncno_resizeno_flipno_convertkeep_aspect_ratiocreated_atupdated_at
<%= link_to original_license.id, :action => :browse, :id => original_license.id %><%= link_to original_license.artist_id, :controller => 'artists', :action => :browse, :id => original_license.artist_id %><%= h original_license.name %><%= h original_license.url %><%= original_license.cc_by %><%= original_license.cc_sa %><%= original_license.cc_nd %><%= original_license.cc_nc %><%= original_license.no_resize %><%= original_license.no_flip %><%= original_license.no_convert %><%= original_license.keep_aspect_ratio %><%= original_license.created_at %><%= original_license.updated_at %><%= link_to 'Edit', edit_original_license_path(original_license) %><%= link_to 'Destroy', original_license, confirm: 'Are you sure?', method: :delete %>
+ diff --git a/app/views/original_licenses/new.html.erb b/app/views/original_licenses/new.html.erb new file mode 100644 index 00000000..122c37e1 --- /dev/null +++ b/app/views/original_licenses/new.html.erb @@ -0,0 +1,5 @@ +

New original_license

+ +<%= render 'form' %> + +<%= link_to 'Back', licenses_path %> diff --git a/app/views/original_licenses/show.html.erb b/app/views/original_licenses/show.html.erb new file mode 100644 index 00000000..2f6b3050 --- /dev/null +++ b/app/views/original_licenses/show.html.erb @@ -0,0 +1,58 @@ +

<%= notice %>

+ +

+ name: + <%= h @original_license.name %> +

+ +

+ url: + <%= h @original_license.url %> +

+ +

+ artist: + <%= @original_license.artist_id %> +

+

+ cc_by: + <%= @original_license.cc_by %> +

+ +

+ cc_sa: + <%= @original_license.cc_sa %> +

+ +

+ cc_nd: + <%= @original_license.cc_nd %> +

+ +

+ cc_nc: + <%= @original_license.cc_nc %> +

+ +

+ no_resize: + <%= @original_license.no_resize %> +

+ +

+ no_flip: + <%= @original_license.no_flip %> +

+ +

+ no_convert: + <%= @original_license.no_convert %> +

+ +

+ keep_aspect_ratio: + <%= @original_license.keep_aspect_ratio %> +

+ +<%= link_to 'Edit', edit_original_license_path(@original_license) %> | +<%= link_to 'Back', original_licenses_path %> diff --git a/app/views/original_lisences/browse.html.erb b/app/views/original_lisences/browse.html.erb deleted file mode 100644 index ecc0f36a..00000000 --- a/app/views/original_lisences/browse.html.erb +++ /dev/null @@ -1,57 +0,0 @@ -

<%= notice %>

- -

- name: - <%= h @original_lisence.name %> -

- -

- url: - <%= h @original_lisence.url %> -

- -

- artist: - <%= @original_lisence.artist_id %> -

-

- cc_by: - <%= @original_lisence.cc_by %> -

- -

- cc_sa: - <%= @original_lisence.cc_sa %> -

- -

- cc_nd: - <%= @original_lisence.cc_nd %> -

- -

- cc_nc: - <%= @original_lisence.cc_nc %> -

- -

- no_resize: - <%= @original_lisence.no_resize %> -

- -

- no_flip: - <%= @original_lisence.no_flip %> -

- -

- no_convert: - <%= @original_lisence.no_convert %> -

- -

- keep_aspect_ratio: - <%= @original_lisence.keep_aspect_ratio %> -

- -<%= link_to 'Back', :action => :list %> diff --git a/app/views/original_lisences/edit.html.erb b/app/views/original_lisences/edit.html.erb deleted file mode 100644 index dd54b16d..00000000 --- a/app/views/original_lisences/edit.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -

Editing original_lisence

- -<%= render 'form' %> - -<%= link_to 'Show', @original_lisence %> | -<%= link_to 'Back', lisences_path %> diff --git a/app/views/original_lisences/index.html.erb b/app/views/original_lisences/index.html.erb deleted file mode 100644 index 570b54c2..00000000 --- a/app/views/original_lisences/index.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -

Listing original_lisences

- - - - - - - - -<% @original_lisences.each do |original_lisence| %> - - - - - -<% end %> -
<%= link_to 'Show', original_lisence %><%= link_to 'Edit', edit_original_lisence_path(original_lisence) %><%= link_to 'Destroy', original_lisence, confirm: 'Are you sure?', method: :delete %>
- -
- -<%= link_to 'New Original lisence', new_original_lisence_path %> diff --git a/app/views/original_lisences/list.html.erb b/app/views/original_lisences/list.html.erb deleted file mode 100644 index 3584f5bc..00000000 --- a/app/views/original_lisences/list.html.erb +++ /dev/null @@ -1,45 +0,0 @@ -

Listing original_lisences

- - - - - - - - - - - - - - - - - - - - - - -<% @original_lisences.each do |original_lisence| %> - - - - - - - - - - - - - - - - - - -<% end %> -
idartist_idlisence_idnameurlcc_bycc_sacc_ndcc_ncno_resizeno_flipno_convertkeep_aspect_ratiocreated_atupdated_at
<%= link_to original_lisence.id, :action => :browse, :id => original_lisence.id %><%= link_to original_lisence.artist_id, :controller => 'artists', :action => :browse, :id => original_lisence.artist_id %><%= h original_lisence.name %><%= h original_lisence.url %><%= original_lisence.cc_by %><%= original_lisence.cc_sa %><%= original_lisence.cc_nd %><%= original_lisence.cc_nc %><%= original_lisence.no_resize %><%= original_lisence.no_flip %><%= original_lisence.no_convert %><%= original_lisence.keep_aspect_ratio %><%= original_lisence.created_at %><%= original_lisence.updated_at %><%= link_to 'Edit', edit_original_lisence_path(original_lisence) %><%= link_to 'Destroy', original_lisence, confirm: 'Are you sure?', method: :delete %>
- diff --git a/app/views/original_lisences/new.html.erb b/app/views/original_lisences/new.html.erb deleted file mode 100644 index 14de64dd..00000000 --- a/app/views/original_lisences/new.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -

New original_lisence

- -<%= render 'form' %> - -<%= link_to 'Back', lisences_path %> diff --git a/app/views/original_lisences/show.html.erb b/app/views/original_lisences/show.html.erb deleted file mode 100644 index b0e3fe44..00000000 --- a/app/views/original_lisences/show.html.erb +++ /dev/null @@ -1,58 +0,0 @@ -

<%= notice %>

- -

- name: - <%= h @original_lisence.name %> -

- -

- url: - <%= h @original_lisence.url %> -

- -

- artist: - <%= @original_lisence.artist_id %> -

-

- cc_by: - <%= @original_lisence.cc_by %> -

- -

- cc_sa: - <%= @original_lisence.cc_sa %> -

- -

- cc_nd: - <%= @original_lisence.cc_nd %> -

- -

- cc_nc: - <%= @original_lisence.cc_nc %> -

- -

- no_resize: - <%= @original_lisence.no_resize %> -

- -

- no_flip: - <%= @original_lisence.no_flip %> -

- -

- no_convert: - <%= @original_lisence.no_convert %> -

- -

- keep_aspect_ratio: - <%= @original_lisence.keep_aspect_ratio %> -

- -<%= link_to 'Edit', edit_original_lisence_path(@original_lisence) %> | -<%= link_to 'Back', original_lisences_path %> diff --git a/app/views/original_pictures/_artist_register.html.erb b/app/views/original_pictures/_artist_register.html.erb index a7125bbf..c07140c4 100644 --- a/app/views/original_pictures/_artist_register.html.erb +++ b/app/views/original_pictures/_artist_register.html.erb @@ -18,8 +18,8 @@ <%= f.label :name %>
<%= f.text_field :name %>
- <%= f.label :default_lisence_id %>
- <%= f.number_field :default_lisence_id %> + <%= f.label :default_license_id %>
+ <%= f.number_field :default_license_id %> <%= f.hidden_field :author_id, :value => @artist.author_id %>
diff --git a/app/views/original_pictures/_uploader.html.erb b/app/views/original_pictures/_uploader.html.erb index 8514d843..b09314a4 100644 --- a/app/views/original_pictures/_uploader.html.erb +++ b/app/views/original_pictures/_uploader.html.erb @@ -2,8 +2,8 @@ <% if current_author.artist? -%> <%= form_tag( {:action => "create"} , { :multipart => true }) do %> <%= file_field_tag "original_picture[file]" %> - lisence - <%= collection_select :original_picture, :lisence_id, Lisence.all.map {|l| [l.name, l.id] }, :last, :first, :html => {:selected => current_author.artist.default_lisence_id} %> + license + <%= collection_select :original_picture, :license_id, License.all.map {|l| [l.name, l.id] }, :last, :first, :html => {:selected => current_author.artist.default_license_id} %> <%= submit_tag 'upload' -%> <% end -%> <% else -%> diff --git a/app/views/original_pictures/browse.html.erb b/app/views/original_pictures/browse.html.erb index 2c71650b..4eb5bb07 100644 --- a/app/views/original_pictures/browse.html.erb +++ b/app/views/original_pictures/browse.html.erb @@ -26,8 +26,8 @@

- lisence_id: - <%= @original_picture.lisence_id %> + license_id: + <%= @original_picture.license_id %>

diff --git a/app/views/original_pictures/index.html.erb b/app/views/original_pictures/index.html.erb index d5fdfcbb..8e200759 100644 --- a/app/views/original_pictures/index.html.erb +++ b/app/views/original_pictures/index.html.erb @@ -8,7 +8,7 @@ <%= original_picture.width %>x<%= original_picture.height %> <%= original_picture.filesize %>bytes 画:<%= h original_picture.artist.name %> - lisence:<%= h Lisence.find(original_picture.lisence_id || 1).name %> + license:<%= h License.find(original_picture.license_id || 1).name %>
<% end %> <%= link_to 'open form', new_original_picture_path, :remote => true %> diff --git a/app/views/original_pictures/list.html.erb b/app/views/original_pictures/list.html.erb index 7859ddb9..49cf13e8 100644 --- a/app/views/original_pictures/list.html.erb +++ b/app/views/original_pictures/list.html.erb @@ -9,7 +9,7 @@ Height filesize artist - lisence_id + license_id created_at updated_at @@ -23,7 +23,7 @@ <%= original_picture.height %> <%= original_picture.filesize %> <%= link_to original_picture.artist_id, :controller => 'artists', :action => :browse, :id => original_picture.artist_id %> - <%= link_to original_picture.lisence_id, :controller => 'lisences', :action => :browse, :id => original_picture.lisence_id %> + <%= link_to original_picture.license_id, :controller => 'licenses', :action => :browse, :id => original_picture.license_id %> <%= original_picture.created_at %> <%= original_picture.updated_at %> diff --git a/app/views/resource_pictures/list.html.erb b/app/views/resource_pictures/list.html.erb index 87fc3a9b..6e9fd441 100644 --- a/app/views/resource_pictures/list.html.erb +++ b/app/views/resource_pictures/list.html.erb @@ -8,7 +8,7 @@ Height filesize artist - lisence_id + license_id original_picture_id created_at updated_at @@ -22,7 +22,7 @@ <%= resource_picture.height %> <%= resource_picture.filesize %> <%= link_to resource_picture.artist_id, :controller => 'artists', :action => :browse, :id => resource_picture.artist_id %> - <%= link_to resource_picture.lisence_id, :controller => 'lisences', :action => :browse, :id => resource_picture.lisence_id %> + <%= link_to resource_picture.license_id, :controller => 'licenses', :action => :browse, :id => resource_picture.license_id %> <%= link_to resource_picture.original_picture_id, :controller => 'original_pictures', :action => :browse, :id => resource_picture.original_picture_id%> <%= resource_picture.created_at %> <%= resource_picture.updated_at %> diff --git a/app/views/system/browse.html.erb b/app/views/system/browse.html.erb index d69f8180..b7eb7fae 100644 --- a/app/views/system/browse.html.erb +++ b/app/views/system/browse.html.erb @@ -71,17 +71,17 @@ - <%= link_to 'lesences', :controller => 'lisences', :action => :list %> + <%= link_to 'lesences', :controller => 'licenses', :action => :list %> - <%= link_to 'common lesences', :controller => 'common_lisences', :action => :list %> + <%= link_to 'common lesences', :controller => 'common_licenses', :action => :list %> - <%= link_to 'original lesences', :controller => 'original_lisences', :action => :list %> + <%= link_to 'original lesences', :controller => 'original_licenses', :action => :list %> diff --git a/config/routes.rb b/config/routes.rb index 2a20daaf..8a92433a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -132,7 +132,7 @@ Pettanr::Application.routes.draw do delete :destroy end end - resources :lisences do + resources :licenses do collection do get :index get :show @@ -140,7 +140,7 @@ Pettanr::Application.routes.draw do get :browse end end - resources :original_lisences do + resources :original_licenses do collection do get :index get :show @@ -155,7 +155,7 @@ Pettanr::Application.routes.draw do delete :destroy end end - resources :common_lisences do + resources :common_licenses do collection do get :index get :show diff --git a/db/migrate/20111206095746_create_artists.rb b/db/migrate/20111206095746_create_artists.rb index be913722..6c326099 100644 --- a/db/migrate/20111206095746_create_artists.rb +++ b/db/migrate/20111206095746_create_artists.rb @@ -5,7 +5,7 @@ class CreateArtists < ActiveRecord::Migration t.string :name t.string :homepage_url t.string :api_url - t.integer :default_lisence_id, :null => false, :default => 0 + t.integer :default_license_id, :null => false, :default => 0 t.timestamp :crowled_at t.timestamps diff --git a/db/migrate/20111206100750_create_lisences.rb b/db/migrate/20111206100750_create_licenses.rb similarity index 80% rename from db/migrate/20111206100750_create_lisences.rb rename to db/migrate/20111206100750_create_licenses.rb index f4219963..58daea14 100644 --- a/db/migrate/20111206100750_create_lisences.rb +++ b/db/migrate/20111206100750_create_licenses.rb @@ -1,6 +1,6 @@ -class CreateLisences < ActiveRecord::Migration +class CreateLicenses < ActiveRecord::Migration def change - create_table :lisences do |t| + create_table :licenses do |t| t.string :name, :null => false t.string :url, :null => false t.integer :cc_by, :null => false, :default => 0 @@ -14,6 +14,6 @@ class CreateLisences < ActiveRecord::Migration t.timestamps end - add_index :lisences, [:url], :unique => true + add_index :licenses, [:url], :unique => true end end diff --git a/db/migrate/20111206105022_create_original_lisences.rb b/db/migrate/20111206105022_create_original_licenses.rb similarity index 80% rename from db/migrate/20111206105022_create_original_lisences.rb rename to db/migrate/20111206105022_create_original_licenses.rb index 0eac623c..a74aef23 100644 --- a/db/migrate/20111206105022_create_original_lisences.rb +++ b/db/migrate/20111206105022_create_original_licenses.rb @@ -1,8 +1,8 @@ -class CreateOriginalLisences < ActiveRecord::Migration +class CreateOriginalLicenses < ActiveRecord::Migration def change - create_table :original_lisences do |t| + create_table :original_licenses do |t| t.integer :artist_id, :null => false - t.integer :lisence_id, :null => false + t.integer :license_id, :null => false t.string :name, :null => false t.string :url, :null => false t.integer :cc_by, :null => false, :default => 0 diff --git a/db/migrate/20111206112042_create_original_pictures.rb b/db/migrate/20111206112042_create_original_pictures.rb index 8c193e31..e492275d 100644 --- a/db/migrate/20111206112042_create_original_pictures.rb +++ b/db/migrate/20111206112042_create_original_pictures.rb @@ -6,7 +6,7 @@ class CreateOriginalPictures < ActiveRecord::Migration t.integer :height, :null => false t.integer :filesize, :null => false t.integer :artist_id, :null => false, :default => 0 - t.integer :lisence_id, :null => false, :default => 0 + t.integer :license_id, :null => false, :default => 0 t.timestamps end diff --git a/db/migrate/20111206112949_create_resource_pictures.rb b/db/migrate/20111206112949_create_resource_pictures.rb index 3dfa27e2..fdc76f6c 100644 --- a/db/migrate/20111206112949_create_resource_pictures.rb +++ b/db/migrate/20111206112949_create_resource_pictures.rb @@ -6,7 +6,7 @@ class CreateResourcePictures < ActiveRecord::Migration t.integer :height, :null => false t.integer :filesize, :null => false t.integer :artist_id, :null => false, :default => 0 - t.integer :lisence_id, :null => false, :default => 0 + t.integer :license_id, :null => false, :default => 0 t.integer :original_picture_id, :null => false t.timestamps diff --git a/db/migrate/20111213073529_create_common_lisences.rb b/db/migrate/20111213073529_create_common_licenses.rb similarity index 79% rename from db/migrate/20111213073529_create_common_lisences.rb rename to db/migrate/20111213073529_create_common_licenses.rb index f045e648..4f38b8fd 100644 --- a/db/migrate/20111213073529_create_common_lisences.rb +++ b/db/migrate/20111213073529_create_common_licenses.rb @@ -1,7 +1,7 @@ -class CreateCommonLisences < ActiveRecord::Migration +class CreateCommonLicenses < ActiveRecord::Migration def change - create_table :common_lisences do |t| - t.integer :lisence_id, :null => false + create_table :common_licenses do |t| + t.integer :license_id, :null => false t.string :name, :null => false t.string :url, :null => false t.integer :cc_by, :null => false, :default => 0 diff --git a/db/schema.rb b/db/schema.rb index 270ec85c..454f5d34 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -43,7 +43,7 @@ ActiveRecord::Schema.define(:version => 20120102071851) do t.string "name" t.string "homepage_url" t.string "api_url" - t.integer "default_lisence_id" + t.integer "default_license_id" t.datetime "crowled_at" t.datetime "created_at" t.datetime "updated_at" @@ -123,8 +123,8 @@ ActiveRecord::Schema.define(:version => 20120102071851) do add_index "comics", ["author_id"], :name => "index_comics_on_author_id" - create_table "common_lisences", :force => true do |t| - t.integer "lisence_id", :null => false + create_table "common_licenses", :force => true do |t| + t.integer "license_id", :null => false t.string "name", :null => false t.string "url", :null => false t.integer "cc_by", :default => 0, :null => false @@ -139,7 +139,7 @@ ActiveRecord::Schema.define(:version => 20120102071851) do t.datetime "updated_at" end - create_table "lisences", :force => true do |t| + create_table "licenses", :force => true do |t| t.string "name", :null => false t.string "url", :null => false t.integer "cc_by", :default => 0, :null => false @@ -154,11 +154,11 @@ ActiveRecord::Schema.define(:version => 20120102071851) do t.datetime "updated_at" end - add_index "lisences", ["url"], :name => "index_lisences_on_url", :unique => true + add_index "licenses", ["url"], :name => "index_licenses_on_url", :unique => true - create_table "original_lisences", :force => true do |t| + create_table "original_licenses", :force => true do |t| t.integer "artist_id", :null => false - t.integer "lisence_id", :null => false + t.integer "license_id", :null => false t.string "name", :null => false t.string "url", :null => false t.integer "cc_by", :default => 0, :null => false @@ -179,7 +179,7 @@ ActiveRecord::Schema.define(:version => 20120102071851) do t.integer "height", :null => false t.integer "filesize", :null => false t.integer "artist_id" - t.integer "lisence_id" + t.integer "license_id" t.datetime "created_at" t.datetime "updated_at" end @@ -228,7 +228,7 @@ ActiveRecord::Schema.define(:version => 20120102071851) do t.integer "height", :null => false t.integer "filesize", :null => false t.integer "artist_id" - t.integer "lisence_id" + t.integer "license_id" t.integer "original_picture_id", :null => false t.datetime "created_at" t.datetime "updated_at" diff --git a/db/seeds.rb b/db/seeds.rb index 6db2992a..104b9120 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -5,30 +5,30 @@ # # cities = City.new([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.new(name: 'Emanuel', city: cities.first) -cl = CommonLisence.new name: 'Public Domain', +cl = CommonLicense.new name: 'Public Domain', 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', cc_by: 0, cc_sa: 0, cc_nd: 0, cc_nc: 0, no_resize: 0, no_flip: 0, no_convert: 0, keep_aspect_ratio: 0 -cl = CommonLisence.new name: 'Creative Commons 3.0(by)', +cl = CommonLicense.new name: 'Creative Commons 3.0(by)', url: 'http://creativecommons.org/licenses/by/3.0/legalcode', cc_by: 1, cc_sa: 0, cc_nd: 0, cc_nc: 0, no_resize: 0, no_flip: 0, no_convert: 0, keep_aspect_ratio: 0 cl.save_save -cl = CommonLisence.new name: 'Creative Commons 3.0(by_sa)', +cl = CommonLicense.new name: 'Creative Commons 3.0(by_sa)', url: 'http://creativecommons.org/licenses/by-sa/3.0/legalcode', cc_by: 1, cc_sa: 1, cc_nd: 0, cc_nc: 0, no_resize: 0, no_flip: 0, no_convert: 0, keep_aspect_ratio: 0 cl.save_save -cl = CommonLisence.new name: 'Creative Commons 3.0(by_nd)', +cl = CommonLicense.new name: 'Creative Commons 3.0(by_nd)', url: 'http://creativecommons.org/licenses/by-nd/3.0/legalcode', cc_by: 1, cc_sa: 0, cc_nd: 1, cc_nc: 0, no_resize: 0, no_flip: 0, no_convert: 0, keep_aspect_ratio: 0 cl.save_save -cl = CommonLisence.new name: 'Creative Commons 3.0(by_nc)', +cl = CommonLicense.new name: 'Creative Commons 3.0(by_nc)', url: 'http://creativecommons.org/licenses/by-nc/3.0/legalcode', cc_by: 1, cc_sa: 0, cc_nd: 0, cc_nc: 1, no_resize: 0, no_flip: 0, no_convert: 0, keep_aspect_ratio: 0 cl.save_save -cl = CommonLisence.new name: 'Creative Commons 3.0(by_nc_sa)', +cl = CommonLicense.new name: 'Creative Commons 3.0(by_nc_sa)', url: 'http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode', cc_by: 1, cc_sa: 1, cc_nd: 0, cc_nc: 1, no_resize: 0, no_flip: 0, no_convert: 0, keep_aspect_ratio: 0 cl.save_save -cl = CommonLisence.new name: 'Creative Commons 3.0(by_nc_nd)', +cl = CommonLicense.new name: 'Creative Commons 3.0(by_nc_nd)', url: 'http://creativecommons.org/licenses/by-nc-nd/3.0/legalcode', cc_by: 1, cc_sa: 0, cc_nd: 1, cc_nc: 1, no_resize: 0, no_flip: 0, no_convert: 0, keep_aspect_ratio: 0 cl.save_save diff --git a/spec/controllers/common_licenses_controller_spec.rb b/spec/controllers/common_licenses_controller_spec.rb new file mode 100644 index 00000000..57f7bdaf --- /dev/null +++ b/spec/controllers/common_licenses_controller_spec.rb @@ -0,0 +1,157 @@ +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 CommonLicensesController do + + # This should return the minimal set of attributes required to create a valid + # CommonLicense. As you add validations to CommonLicense, be sure to + # update the return value of this method accordingly. + def valid_attributes + {} + end + + describe "GET index" do + it "assigns all common_licenses as @common_licenses" do + common_license = CommonLicense.create! valid_attributes + get :index + assigns(:common_licenses).should eq([common_license]) + end + end + + describe "GET show" do + it "assigns the requested common_license as @common_license" do + common_license = CommonLicense.create! valid_attributes + get :show, :id => common_license.id + assigns(:common_license).should eq(common_license) + end + end + + describe "GET new" do + it "assigns a new common_license as @common_license" do + get :new + assigns(:common_license).should be_a_new(CommonLicense) + end + end + + describe "GET edit" do + it "assigns the requested common_license as @common_license" do + common_license = CommonLicense.create! valid_attributes + get :edit, :id => common_license.id + assigns(:common_license).should eq(common_license) + end + end + + describe "POST create" do + describe "with valid params" do + it "creates a new CommonLicense" do + expect { + post :create, :common_license => valid_attributes + }.to change(CommonLicense, :count).by(1) + end + + it "assigns a newly created common_license as @common_license" do + post :create, :common_license => valid_attributes + assigns(:common_license).should be_a(CommonLicense) + assigns(:common_license).should be_persisted + end + + it "redirects to the created common_license" do + post :create, :common_license => valid_attributes + response.should redirect_to(CommonLicense.last) + end + end + + describe "with invalid params" do + it "assigns a newly created but unsaved common_license as @common_license" do + # Trigger the behavior that occurs when invalid params are submitted + CommonLicense.any_instance.stub(:save).and_return(false) + post :create, :common_license => {} + assigns(:common_license).should be_a_new(CommonLicense) + end + + it "re-renders the 'new' template" do + # Trigger the behavior that occurs when invalid params are submitted + CommonLicense.any_instance.stub(:save).and_return(false) + post :create, :common_license => {} + response.should render_template("new") + end + end + end + + describe "PUT update" do + describe "with valid params" do + it "updates the requested common_license" do + common_license = CommonLicense.create! valid_attributes + # Assuming there are no other common_licenses in the database, this + # specifies that the CommonLicense created on the previous line + # receives the :update_attributes message with whatever params are + # submitted in the request. + CommonLicense.any_instance.should_receive(:update_attributes).with({'these' => 'params'}) + put :update, :id => common_license.id, :common_license => {'these' => 'params'} + end + + it "assigns the requested common_license as @common_license" do + common_license = CommonLicense.create! valid_attributes + put :update, :id => common_license.id, :common_license => valid_attributes + assigns(:common_license).should eq(common_license) + end + + it "redirects to the common_license" do + common_license = CommonLicense.create! valid_attributes + put :update, :id => common_license.id, :common_license => valid_attributes + response.should redirect_to(common_license) + end + end + + describe "with invalid params" do + it "assigns the common_license as @common_license" do + common_license = CommonLicense.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + CommonLicense.any_instance.stub(:save).and_return(false) + put :update, :id => common_license.id, :common_license => {} + assigns(:common_license).should eq(common_license) + end + + it "re-renders the 'edit' template" do + common_license = CommonLicense.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + CommonLicense.any_instance.stub(:save).and_return(false) + put :update, :id => common_license.id, :common_license => {} + response.should render_template("edit") + end + end + end + + describe "DELETE destroy" do + it "destroys the requested common_license" do + common_license = CommonLicense.create! valid_attributes + expect { + delete :destroy, :id => common_license.id + }.to change(CommonLicense, :count).by(-1) + end + + it "redirects to the common_licenses list" do + common_license = CommonLicense.create! valid_attributes + delete :destroy, :id => common_license.id + response.should redirect_to(common_licenses_url) + end + end + +end diff --git a/spec/controllers/common_lisences_controller_spec.rb b/spec/controllers/common_lisences_controller_spec.rb deleted file mode 100644 index b0889e11..00000000 --- a/spec/controllers/common_lisences_controller_spec.rb +++ /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 CommonLisencesController do - - # This should return the minimal set of attributes required to create a valid - # CommonLisence. As you add validations to CommonLisence, be sure to - # update the return value of this method accordingly. - def valid_attributes - {} - end - - describe "GET index" do - it "assigns all common_lisences as @common_lisences" do - common_lisence = CommonLisence.create! valid_attributes - get :index - assigns(:common_lisences).should eq([common_lisence]) - end - end - - describe "GET show" do - it "assigns the requested common_lisence as @common_lisence" do - common_lisence = CommonLisence.create! valid_attributes - get :show, :id => common_lisence.id - assigns(:common_lisence).should eq(common_lisence) - end - end - - describe "GET new" do - it "assigns a new common_lisence as @common_lisence" do - get :new - assigns(:common_lisence).should be_a_new(CommonLisence) - end - end - - describe "GET edit" do - it "assigns the requested common_lisence as @common_lisence" do - common_lisence = CommonLisence.create! valid_attributes - get :edit, :id => common_lisence.id - assigns(:common_lisence).should eq(common_lisence) - end - end - - describe "POST create" do - describe "with valid params" do - it "creates a new CommonLisence" do - expect { - post :create, :common_lisence => valid_attributes - }.to change(CommonLisence, :count).by(1) - end - - it "assigns a newly created common_lisence as @common_lisence" do - post :create, :common_lisence => valid_attributes - assigns(:common_lisence).should be_a(CommonLisence) - assigns(:common_lisence).should be_persisted - end - - it "redirects to the created common_lisence" do - post :create, :common_lisence => valid_attributes - response.should redirect_to(CommonLisence.last) - end - end - - describe "with invalid params" do - it "assigns a newly created but unsaved common_lisence as @common_lisence" do - # Trigger the behavior that occurs when invalid params are submitted - CommonLisence.any_instance.stub(:save).and_return(false) - post :create, :common_lisence => {} - assigns(:common_lisence).should be_a_new(CommonLisence) - end - - it "re-renders the 'new' template" do - # Trigger the behavior that occurs when invalid params are submitted - CommonLisence.any_instance.stub(:save).and_return(false) - post :create, :common_lisence => {} - response.should render_template("new") - end - end - end - - describe "PUT update" do - describe "with valid params" do - it "updates the requested common_lisence" do - common_lisence = CommonLisence.create! valid_attributes - # Assuming there are no other common_lisences in the database, this - # specifies that the CommonLisence created on the previous line - # receives the :update_attributes message with whatever params are - # submitted in the request. - CommonLisence.any_instance.should_receive(:update_attributes).with({'these' => 'params'}) - put :update, :id => common_lisence.id, :common_lisence => {'these' => 'params'} - end - - it "assigns the requested common_lisence as @common_lisence" do - common_lisence = CommonLisence.create! valid_attributes - put :update, :id => common_lisence.id, :common_lisence => valid_attributes - assigns(:common_lisence).should eq(common_lisence) - end - - it "redirects to the common_lisence" do - common_lisence = CommonLisence.create! valid_attributes - put :update, :id => common_lisence.id, :common_lisence => valid_attributes - response.should redirect_to(common_lisence) - end - end - - describe "with invalid params" do - it "assigns the common_lisence as @common_lisence" do - common_lisence = CommonLisence.create! valid_attributes - # Trigger the behavior that occurs when invalid params are submitted - CommonLisence.any_instance.stub(:save).and_return(false) - put :update, :id => common_lisence.id, :common_lisence => {} - assigns(:common_lisence).should eq(common_lisence) - end - - it "re-renders the 'edit' template" do - common_lisence = CommonLisence.create! valid_attributes - # Trigger the behavior that occurs when invalid params are submitted - CommonLisence.any_instance.stub(:save).and_return(false) - put :update, :id => common_lisence.id, :common_lisence => {} - response.should render_template("edit") - end - end - end - - describe "DELETE destroy" do - it "destroys the requested common_lisence" do - common_lisence = CommonLisence.create! valid_attributes - expect { - delete :destroy, :id => common_lisence.id - }.to change(CommonLisence, :count).by(-1) - end - - it "redirects to the common_lisences list" do - common_lisence = CommonLisence.create! valid_attributes - delete :destroy, :id => common_lisence.id - response.should redirect_to(common_lisences_url) - end - end - -end diff --git a/spec/controllers/licenses_controller_spec.rb b/spec/controllers/licenses_controller_spec.rb new file mode 100644 index 00000000..f12c7040 --- /dev/null +++ b/spec/controllers/licenses_controller_spec.rb @@ -0,0 +1,157 @@ +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 + 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) + end + + it "redirects to the licenses list" do + license = License.create! valid_attributes + delete :destroy, :id => license.id + response.should redirect_to(licenses_url) + end + end + +end diff --git a/spec/controllers/lisences_controller_spec.rb b/spec/controllers/lisences_controller_spec.rb deleted file mode 100644 index 3172fd31..00000000 --- a/spec/controllers/lisences_controller_spec.rb +++ /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 LisencesController do - - # This should return the minimal set of attributes required to create a valid - # Lisence. As you add validations to Lisence, be sure to - # update the return value of this method accordingly. - def valid_attributes - {} - end - - describe "GET index" do - it "assigns all lisences as @lisences" do - lisence = Lisence.create! valid_attributes - get :index - assigns(:lisences).should eq([lisence]) - end - end - - describe "GET show" do - it "assigns the requested lisence as @lisence" do - lisence = Lisence.create! valid_attributes - get :show, :id => lisence.id - assigns(:lisence).should eq(lisence) - end - end - - describe "GET new" do - it "assigns a new lisence as @lisence" do - get :new - assigns(:lisence).should be_a_new(Lisence) - end - end - - describe "GET edit" do - it "assigns the requested lisence as @lisence" do - lisence = Lisence.create! valid_attributes - get :edit, :id => lisence.id - assigns(:lisence).should eq(lisence) - end - end - - describe "POST create" do - describe "with valid params" do - it "creates a new Lisence" do - expect { - post :create, :lisence => valid_attributes - }.to change(Lisence, :count).by(1) - end - - it "assigns a newly created lisence as @lisence" do - post :create, :lisence => valid_attributes - assigns(:lisence).should be_a(Lisence) - assigns(:lisence).should be_persisted - end - - it "redirects to the created lisence" do - post :create, :lisence => valid_attributes - response.should redirect_to(Lisence.last) - end - end - - describe "with invalid params" do - it "assigns a newly created but unsaved lisence as @lisence" do - # Trigger the behavior that occurs when invalid params are submitted - Lisence.any_instance.stub(:save).and_return(false) - post :create, :lisence => {} - assigns(:lisence).should be_a_new(Lisence) - end - - it "re-renders the 'new' template" do - # Trigger the behavior that occurs when invalid params are submitted - Lisence.any_instance.stub(:save).and_return(false) - post :create, :lisence => {} - response.should render_template("new") - end - end - end - - describe "PUT update" do - describe "with valid params" do - it "updates the requested lisence" do - lisence = Lisence.create! valid_attributes - # Assuming there are no other lisences in the database, this - # specifies that the Lisence created on the previous line - # receives the :update_attributes message with whatever params are - # submitted in the request. - Lisence.any_instance.should_receive(:update_attributes).with({'these' => 'params'}) - put :update, :id => lisence.id, :lisence => {'these' => 'params'} - end - - it "assigns the requested lisence as @lisence" do - lisence = Lisence.create! valid_attributes - put :update, :id => lisence.id, :lisence => valid_attributes - assigns(:lisence).should eq(lisence) - end - - it "redirects to the lisence" do - lisence = Lisence.create! valid_attributes - put :update, :id => lisence.id, :lisence => valid_attributes - response.should redirect_to(lisence) - end - end - - describe "with invalid params" do - it "assigns the lisence as @lisence" do - lisence = Lisence.create! valid_attributes - # Trigger the behavior that occurs when invalid params are submitted - Lisence.any_instance.stub(:save).and_return(false) - put :update, :id => lisence.id, :lisence => {} - assigns(:lisence).should eq(lisence) - end - - it "re-renders the 'edit' template" do - lisence = Lisence.create! valid_attributes - # Trigger the behavior that occurs when invalid params are submitted - Lisence.any_instance.stub(:save).and_return(false) - put :update, :id => lisence.id, :lisence => {} - response.should render_template("edit") - end - end - end - - describe "DELETE destroy" do - it "destroys the requested lisence" do - lisence = Lisence.create! valid_attributes - expect { - delete :destroy, :id => lisence.id - }.to change(Lisence, :count).by(-1) - end - - it "redirects to the lisences list" do - lisence = Lisence.create! valid_attributes - delete :destroy, :id => lisence.id - response.should redirect_to(lisences_url) - end - end - -end diff --git a/spec/controllers/original_licenses_controller_spec.rb b/spec/controllers/original_licenses_controller_spec.rb new file mode 100644 index 00000000..819760a4 --- /dev/null +++ b/spec/controllers/original_licenses_controller_spec.rb @@ -0,0 +1,157 @@ +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 + get :index + 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/original_lisences_controller_spec.rb b/spec/controllers/original_lisences_controller_spec.rb deleted file mode 100644 index ecd6f09b..00000000 --- a/spec/controllers/original_lisences_controller_spec.rb +++ /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 OriginalLisencesController do - - # This should return the minimal set of attributes required to create a valid - # OriginalLisence. As you add validations to OriginalLisence, be sure to - # update the return value of this method accordingly. - def valid_attributes - {} - end - - describe "GET index" do - it "assigns all original_lisences as @original_lisences" do - original_lisence = OriginalLisence.create! valid_attributes - get :index - assigns(:original_lisences).should eq([original_lisence]) - end - end - - describe "GET show" do - it "assigns the requested original_lisence as @original_lisence" do - original_lisence = OriginalLisence.create! valid_attributes - get :show, :id => original_lisence.id - assigns(:original_lisence).should eq(original_lisence) - end - end - - describe "GET new" do - it "assigns a new original_lisence as @original_lisence" do - get :new - assigns(:original_lisence).should be_a_new(OriginalLisence) - end - end - - describe "GET edit" do - it "assigns the requested original_lisence as @original_lisence" do - original_lisence = OriginalLisence.create! valid_attributes - get :edit, :id => original_lisence.id - assigns(:original_lisence).should eq(original_lisence) - end - end - - describe "POST create" do - describe "with valid params" do - it "creates a new OriginalLisence" do - expect { - post :create, :original_lisence => valid_attributes - }.to change(OriginalLisence, :count).by(1) - end - - it "assigns a newly created original_lisence as @original_lisence" do - post :create, :original_lisence => valid_attributes - assigns(:original_lisence).should be_a(OriginalLisence) - assigns(:original_lisence).should be_persisted - end - - it "redirects to the created original_lisence" do - post :create, :original_lisence => valid_attributes - response.should redirect_to(OriginalLisence.last) - end - end - - describe "with invalid params" do - it "assigns a newly created but unsaved original_lisence as @original_lisence" do - # Trigger the behavior that occurs when invalid params are submitted - OriginalLisence.any_instance.stub(:save).and_return(false) - post :create, :original_lisence => {} - assigns(:original_lisence).should be_a_new(OriginalLisence) - end - - it "re-renders the 'new' template" do - # Trigger the behavior that occurs when invalid params are submitted - OriginalLisence.any_instance.stub(:save).and_return(false) - post :create, :original_lisence => {} - response.should render_template("new") - end - end - end - - describe "PUT update" do - describe "with valid params" do - it "updates the requested original_lisence" do - original_lisence = OriginalLisence.create! valid_attributes - # Assuming there are no other original_lisences in the database, this - # specifies that the OriginalLisence created on the previous line - # receives the :update_attributes message with whatever params are - # submitted in the request. - OriginalLisence.any_instance.should_receive(:update_attributes).with({'these' => 'params'}) - put :update, :id => original_lisence.id, :original_lisence => {'these' => 'params'} - end - - it "assigns the requested original_lisence as @original_lisence" do - original_lisence = OriginalLisence.create! valid_attributes - put :update, :id => original_lisence.id, :original_lisence => valid_attributes - assigns(:original_lisence).should eq(original_lisence) - end - - it "redirects to the original_lisence" do - original_lisence = OriginalLisence.create! valid_attributes - put :update, :id => original_lisence.id, :original_lisence => valid_attributes - response.should redirect_to(original_lisence) - end - end - - describe "with invalid params" do - it "assigns the original_lisence as @original_lisence" do - original_lisence = OriginalLisence.create! valid_attributes - # Trigger the behavior that occurs when invalid params are submitted - OriginalLisence.any_instance.stub(:save).and_return(false) - put :update, :id => original_lisence.id, :original_lisence => {} - assigns(:original_lisence).should eq(original_lisence) - end - - it "re-renders the 'edit' template" do - original_lisence = OriginalLisence.create! valid_attributes - # Trigger the behavior that occurs when invalid params are submitted - OriginalLisence.any_instance.stub(:save).and_return(false) - put :update, :id => original_lisence.id, :original_lisence => {} - response.should render_template("edit") - end - end - end - - describe "DELETE destroy" do - it "destroys the requested original_lisence" do - original_lisence = OriginalLisence.create! valid_attributes - expect { - delete :destroy, :id => original_lisence.id - }.to change(OriginalLisence, :count).by(-1) - end - - it "redirects to the original_lisences list" do - original_lisence = OriginalLisence.create! valid_attributes - delete :destroy, :id => original_lisence.id - response.should redirect_to(original_lisences_url) - end - end - -end diff --git a/spec/helpers/common_lisences_helper_spec.rb b/spec/helpers/common_licenses_helper_spec.rb similarity index 74% rename from spec/helpers/common_lisences_helper_spec.rb rename to spec/helpers/common_licenses_helper_spec.rb index 25c85dc0..50c24c73 100644 --- a/spec/helpers/common_lisences_helper_spec.rb +++ b/spec/helpers/common_licenses_helper_spec.rb @@ -1,15 +1,15 @@ require 'spec_helper' # Specs in this file have access to a helper object that includes -# the CommonLisencesHelper. For example: +# the CommonLicensesHelper. For example: # -# describe CommonLisencesHelper do +# describe CommonLicensesHelper do # describe "string concat" do # it "concats two strings with spaces" do # helper.concat_strings("this","that").should == "this that" # end # end # end -describe CommonLisencesHelper do +describe CommonLicensesHelper do pending "add some examples to (or delete) #{__FILE__}" end diff --git a/spec/helpers/lisences_helper_spec.rb b/spec/helpers/licenses_helper_spec.rb similarity index 77% rename from spec/helpers/lisences_helper_spec.rb rename to spec/helpers/licenses_helper_spec.rb index bf41193c..832b7963 100644 --- a/spec/helpers/lisences_helper_spec.rb +++ b/spec/helpers/licenses_helper_spec.rb @@ -1,15 +1,15 @@ require 'spec_helper' # Specs in this file have access to a helper object that includes -# the LisencesHelper. For example: +# the LicensesHelper. For example: # -# describe LisencesHelper do +# describe LicensesHelper do # describe "string concat" do # it "concats two strings with spaces" do # helper.concat_strings("this","that").should == "this that" # end # end # end -describe LisencesHelper do +describe LicensesHelper do pending "add some examples to (or delete) #{__FILE__}" end diff --git a/spec/helpers/original_lisences_helper_spec.rb b/spec/helpers/original_licenses_helper_spec.rb similarity index 73% rename from spec/helpers/original_lisences_helper_spec.rb rename to spec/helpers/original_licenses_helper_spec.rb index e7e138f6..9fc30758 100644 --- a/spec/helpers/original_lisences_helper_spec.rb +++ b/spec/helpers/original_licenses_helper_spec.rb @@ -1,15 +1,15 @@ require 'spec_helper' # Specs in this file have access to a helper object that includes -# the OriginalLisencesHelper. For example: +# the OriginalLicensesHelper. For example: # -# describe OriginalLisencesHelper do +# describe OriginalLicensesHelper do # describe "string concat" do # it "concats two strings with spaces" do # helper.concat_strings("this","that").should == "this that" # end # end # end -describe OriginalLisencesHelper do +describe OriginalLicensesHelper do pending "add some examples to (or delete) #{__FILE__}" end diff --git a/spec/models/common_lisence_spec.rb b/spec/models/common_license_spec.rb similarity index 76% rename from spec/models/common_lisence_spec.rb rename to spec/models/common_license_spec.rb index a364231d..352eb924 100644 --- a/spec/models/common_lisence_spec.rb +++ b/spec/models/common_license_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe CommonLisence do +describe CommonLicense do pending "add some examples to (or delete) #{__FILE__}" end diff --git a/spec/models/lisence_spec.rb b/spec/models/license_spec.rb similarity index 80% rename from spec/models/lisence_spec.rb rename to spec/models/license_spec.rb index 237d81e1..8027ddb4 100644 --- a/spec/models/lisence_spec.rb +++ b/spec/models/license_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe Lisence do +describe License do pending "add some examples to (or delete) #{__FILE__}" end diff --git a/spec/models/original_lisence_spec.rb b/spec/models/original_license_spec.rb similarity index 75% rename from spec/models/original_lisence_spec.rb rename to spec/models/original_license_spec.rb index 35c5c9ef..36b21b52 100644 --- a/spec/models/original_lisence_spec.rb +++ b/spec/models/original_license_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe OriginalLisence do +describe OriginalLicense do pending "add some examples to (or delete) #{__FILE__}" end diff --git a/spec/requests/common_lisences_spec.rb b/spec/requests/common_licenses_spec.rb similarity index 69% rename from spec/requests/common_lisences_spec.rb rename to spec/requests/common_licenses_spec.rb index d04d49a1..6dad5851 100644 --- a/spec/requests/common_lisences_spec.rb +++ b/spec/requests/common_licenses_spec.rb @@ -1,10 +1,10 @@ require 'spec_helper' -describe "CommonLisences" do - describe "GET /common_lisences" do +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_lisences_path + get common_licenses_path response.status.should be(200) end end diff --git a/spec/requests/lisences_spec.rb b/spec/requests/licenses_spec.rb similarity index 74% rename from spec/requests/lisences_spec.rb rename to spec/requests/licenses_spec.rb index 54ed4c90..fbbe38a9 100644 --- a/spec/requests/lisences_spec.rb +++ b/spec/requests/licenses_spec.rb @@ -1,10 +1,10 @@ require 'spec_helper' -describe "Lisences" do - describe "GET /lisences" do +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 lisences_path + get licenses_path response.status.should be(200) end end diff --git a/spec/requests/original_lisences_spec.rb b/spec/requests/original_licenses_spec.rb similarity index 68% rename from spec/requests/original_lisences_spec.rb rename to spec/requests/original_licenses_spec.rb index 6a01a216..6b12b4af 100644 --- a/spec/requests/original_lisences_spec.rb +++ b/spec/requests/original_licenses_spec.rb @@ -1,10 +1,10 @@ require 'spec_helper' -describe "OriginalLisences" do - describe "GET /original_lisences" do +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_lisences_path + get original_licenses_path response.status.should be(200) end end diff --git a/spec/routing/common_licenses_routing_spec.rb b/spec/routing/common_licenses_routing_spec.rb new file mode 100644 index 00000000..9e945f68 --- /dev/null +++ b/spec/routing/common_licenses_routing_spec.rb @@ -0,0 +1,35 @@ +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/common_lisences_routing_spec.rb b/spec/routing/common_lisences_routing_spec.rb deleted file mode 100644 index f42578f4..00000000 --- a/spec/routing/common_lisences_routing_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -require "spec_helper" - -describe CommonLisencesController do - describe "routing" do - - it "routes to #index" do - get("/common_lisences").should route_to("common_lisences#index") - end - - it "routes to #new" do - get("/common_lisences/new").should route_to("common_lisences#new") - end - - it "routes to #show" do - get("/common_lisences/1").should route_to("common_lisences#show", :id => "1") - end - - it "routes to #edit" do - get("/common_lisences/1/edit").should route_to("common_lisences#edit", :id => "1") - end - - it "routes to #create" do - post("/common_lisences").should route_to("common_lisences#create") - end - - it "routes to #update" do - put("/common_lisences/1").should route_to("common_lisences#update", :id => "1") - end - - it "routes to #destroy" do - delete("/common_lisences/1").should route_to("common_lisences#destroy", :id => "1") - end - - end -end diff --git a/spec/routing/licenses_routing_spec.rb b/spec/routing/licenses_routing_spec.rb new file mode 100644 index 00000000..c09d76db --- /dev/null +++ b/spec/routing/licenses_routing_spec.rb @@ -0,0 +1,35 @@ +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/lisences_routing_spec.rb b/spec/routing/lisences_routing_spec.rb deleted file mode 100644 index 2882601b..00000000 --- a/spec/routing/lisences_routing_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -require "spec_helper" - -describe LisencesController do - describe "routing" do - - it "routes to #index" do - get("/lisences").should route_to("lisences#index") - end - - it "routes to #new" do - get("/lisences/new").should route_to("lisences#new") - end - - it "routes to #show" do - get("/lisences/1").should route_to("lisences#show", :id => "1") - end - - it "routes to #edit" do - get("/lisences/1/edit").should route_to("lisences#edit", :id => "1") - end - - it "routes to #create" do - post("/lisences").should route_to("lisences#create") - end - - it "routes to #update" do - put("/lisences/1").should route_to("lisences#update", :id => "1") - end - - it "routes to #destroy" do - delete("/lisences/1").should route_to("lisences#destroy", :id => "1") - end - - end -end diff --git a/spec/routing/original_licenses_routing_spec.rb b/spec/routing/original_licenses_routing_spec.rb new file mode 100644 index 00000000..49050509 --- /dev/null +++ b/spec/routing/original_licenses_routing_spec.rb @@ -0,0 +1,35 @@ +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_lisences_routing_spec.rb b/spec/routing/original_lisences_routing_spec.rb deleted file mode 100644 index 95d3d488..00000000 --- a/spec/routing/original_lisences_routing_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -require "spec_helper" - -describe OriginalLisencesController do - describe "routing" do - - it "routes to #index" do - get("/original_lisences").should route_to("original_lisences#index") - end - - it "routes to #new" do - get("/original_lisences/new").should route_to("original_lisences#new") - end - - it "routes to #show" do - get("/original_lisences/1").should route_to("original_lisences#show", :id => "1") - end - - it "routes to #edit" do - get("/original_lisences/1/edit").should route_to("original_lisences#edit", :id => "1") - end - - it "routes to #create" do - post("/original_lisences").should route_to("original_lisences#create") - end - - it "routes to #update" do - put("/original_lisences/1").should route_to("original_lisences#update", :id => "1") - end - - it "routes to #destroy" do - delete("/original_lisences/1").should route_to("original_lisences#destroy", :id => "1") - end - - end -end diff --git a/spec/views/common_licenses/edit.html.erb_spec.rb b/spec/views/common_licenses/edit.html.erb_spec.rb new file mode 100644 index 00000000..0e13ac41 --- /dev/null +++ b/spec/views/common_licenses/edit.html.erb_spec.rb @@ -0,0 +1,15 @@ +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 new file mode 100644 index 00000000..8bde076c --- /dev/null +++ b/spec/views/common_licenses/index.html.erb_spec.rb @@ -0,0 +1,14 @@ +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 new file mode 100644 index 00000000..358d4524 --- /dev/null +++ b/spec/views/common_licenses/new.html.erb_spec.rb @@ -0,0 +1,15 @@ +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 new file mode 100644 index 00000000..5c2d07e3 --- /dev/null +++ b/spec/views/common_licenses/show.html.erb_spec.rb @@ -0,0 +1,11 @@ +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

" do + render + end +end diff --git a/spec/views/common_lisences/edit.html.erb_spec.rb b/spec/views/common_lisences/edit.html.erb_spec.rb deleted file mode 100644 index 17730cb3..00000000 --- a/spec/views/common_lisences/edit.html.erb_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'spec_helper' - -describe "common_lisences/edit.html.erb" do - before(:each) do - @common_lisence = assign(:common_lisence, stub_model(CommonLisence)) - end - - it "renders the edit common_lisence form" do - render - - # Run the generator again with the --webrat flag if you want to use webrat matchers - assert_select "form", :action => common_lisences_path(@common_lisence), :method => "post" do - end - end -end diff --git a/spec/views/common_lisences/index.html.erb_spec.rb b/spec/views/common_lisences/index.html.erb_spec.rb deleted file mode 100644 index 85fbfcfd..00000000 --- a/spec/views/common_lisences/index.html.erb_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -require 'spec_helper' - -describe "common_lisences/index.html.erb" do - before(:each) do - assign(:common_lisences, [ - stub_model(CommonLisence), - stub_model(CommonLisence) - ]) - end - - it "renders a list of common_lisences" do - render - end -end diff --git a/spec/views/common_lisences/new.html.erb_spec.rb b/spec/views/common_lisences/new.html.erb_spec.rb deleted file mode 100644 index 3b449a07..00000000 --- a/spec/views/common_lisences/new.html.erb_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'spec_helper' - -describe "common_lisences/new.html.erb" do - before(:each) do - assign(:common_lisence, stub_model(CommonLisence).as_new_record) - end - - it "renders new common_lisence form" do - render - - # Run the generator again with the --webrat flag if you want to use webrat matchers - assert_select "form", :action => common_lisences_path, :method => "post" do - end - end -end diff --git a/spec/views/common_lisences/show.html.erb_spec.rb b/spec/views/common_lisences/show.html.erb_spec.rb deleted file mode 100644 index afd446a9..00000000 --- a/spec/views/common_lisences/show.html.erb_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'spec_helper' - -describe "common_lisences/show.html.erb" do - before(:each) do - @common_lisence = assign(:common_lisence, stub_model(CommonLisence)) - end - - it "renders attributes in

" do - render - end -end diff --git a/spec/views/licenses/edit.html.erb_spec.rb b/spec/views/licenses/edit.html.erb_spec.rb new file mode 100644 index 00000000..8a542c00 --- /dev/null +++ b/spec/views/licenses/edit.html.erb_spec.rb @@ -0,0 +1,15 @@ +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 new file mode 100644 index 00000000..8ddf8101 --- /dev/null +++ b/spec/views/licenses/index.html.erb_spec.rb @@ -0,0 +1,14 @@ +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 new file mode 100644 index 00000000..cb6e05a1 --- /dev/null +++ b/spec/views/licenses/new.html.erb_spec.rb @@ -0,0 +1,15 @@ +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/lisences/show.html.erb_spec.rb b/spec/views/licenses/show.html.erb_spec.rb similarity index 54% rename from spec/views/lisences/show.html.erb_spec.rb rename to spec/views/licenses/show.html.erb_spec.rb index 1fc83c28..58bded3b 100644 --- a/spec/views/lisences/show.html.erb_spec.rb +++ b/spec/views/licenses/show.html.erb_spec.rb @@ -1,8 +1,8 @@ require 'spec_helper' -describe "lisences/show.html.erb" do +describe "licenses/show.html.erb" do before(:each) do - @lisence = assign(:lisence, stub_model(Lisence)) + @license = assign(:license, stub_model(License)) end it "renders attributes in

" do diff --git a/spec/views/lisences/edit.html.erb_spec.rb b/spec/views/lisences/edit.html.erb_spec.rb deleted file mode 100644 index df254889..00000000 --- a/spec/views/lisences/edit.html.erb_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'spec_helper' - -describe "lisences/edit.html.erb" do - before(:each) do - @lisence = assign(:lisence, stub_model(Lisence)) - end - - it "renders the edit lisence form" do - render - - # Run the generator again with the --webrat flag if you want to use webrat matchers - assert_select "form", :action => lisences_path(@lisence), :method => "post" do - end - end -end diff --git a/spec/views/lisences/index.html.erb_spec.rb b/spec/views/lisences/index.html.erb_spec.rb deleted file mode 100644 index 81d62e86..00000000 --- a/spec/views/lisences/index.html.erb_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -require 'spec_helper' - -describe "lisences/index.html.erb" do - before(:each) do - assign(:lisences, [ - stub_model(Lisence), - stub_model(Lisence) - ]) - end - - it "renders a list of lisences" do - render - end -end diff --git a/spec/views/lisences/new.html.erb_spec.rb b/spec/views/lisences/new.html.erb_spec.rb deleted file mode 100644 index 8e76acce..00000000 --- a/spec/views/lisences/new.html.erb_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'spec_helper' - -describe "lisences/new.html.erb" do - before(:each) do - assign(:lisence, stub_model(Lisence).as_new_record) - end - - it "renders new lisence form" do - render - - # Run the generator again with the --webrat flag if you want to use webrat matchers - assert_select "form", :action => lisences_path, :method => "post" do - end - end -end diff --git a/spec/views/original_licenses/edit.html.erb_spec.rb b/spec/views/original_licenses/edit.html.erb_spec.rb new file mode 100644 index 00000000..d96e2986 --- /dev/null +++ b/spec/views/original_licenses/edit.html.erb_spec.rb @@ -0,0 +1,15 @@ +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 new file mode 100644 index 00000000..f410d808 --- /dev/null +++ b/spec/views/original_licenses/index.html.erb_spec.rb @@ -0,0 +1,14 @@ +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 new file mode 100644 index 00000000..5ab1c508 --- /dev/null +++ b/spec/views/original_licenses/new.html.erb_spec.rb @@ -0,0 +1,15 @@ +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 new file mode 100644 index 00000000..d703f90d --- /dev/null +++ b/spec/views/original_licenses/show.html.erb_spec.rb @@ -0,0 +1,11 @@ +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

" do + render + end +end diff --git a/spec/views/original_lisences/edit.html.erb_spec.rb b/spec/views/original_lisences/edit.html.erb_spec.rb deleted file mode 100644 index c909a589..00000000 --- a/spec/views/original_lisences/edit.html.erb_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'spec_helper' - -describe "original_lisences/edit.html.erb" do - before(:each) do - @original_lisence = assign(:original_lisence, stub_model(OriginalLisence)) - end - - it "renders the edit original_lisence form" do - render - - # Run the generator again with the --webrat flag if you want to use webrat matchers - assert_select "form", :action => original_lisences_path(@original_lisence), :method => "post" do - end - end -end diff --git a/spec/views/original_lisences/index.html.erb_spec.rb b/spec/views/original_lisences/index.html.erb_spec.rb deleted file mode 100644 index b9df3778..00000000 --- a/spec/views/original_lisences/index.html.erb_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -require 'spec_helper' - -describe "original_lisences/index.html.erb" do - before(:each) do - assign(:original_lisences, [ - stub_model(OriginalLisence), - stub_model(OriginalLisence) - ]) - end - - it "renders a list of original_lisences" do - render - end -end diff --git a/spec/views/original_lisences/new.html.erb_spec.rb b/spec/views/original_lisences/new.html.erb_spec.rb deleted file mode 100644 index ff3ca119..00000000 --- a/spec/views/original_lisences/new.html.erb_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'spec_helper' - -describe "original_lisences/new.html.erb" do - before(:each) do - assign(:original_lisence, stub_model(OriginalLisence).as_new_record) - end - - it "renders new original_lisence form" do - render - - # Run the generator again with the --webrat flag if you want to use webrat matchers - assert_select "form", :action => original_lisences_path, :method => "post" do - end - end -end diff --git a/spec/views/original_lisences/show.html.erb_spec.rb b/spec/views/original_lisences/show.html.erb_spec.rb deleted file mode 100644 index 40939226..00000000 --- a/spec/views/original_lisences/show.html.erb_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'spec_helper' - -describe "original_lisences/show.html.erb" do - before(:each) do - @original_lisence = assign(:original_lisence, stub_model(OriginalLisence)) - end - - it "renders attributes in

" do - render - end -end -- 2.11.0