a lot of new models ...
Fotogallary, gremien, fetprofil,
This commit is contained in:
3
app/assets/javascripts/fetprofiles.js.coffee
Normal file
3
app/assets/javascripts/fetprofiles.js.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
||||
3
app/assets/javascripts/fotos.js.coffee
Normal file
3
app/assets/javascripts/fotos.js.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
||||
3
app/assets/javascripts/galleries.js.coffee
Normal file
3
app/assets/javascripts/galleries.js.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
||||
3
app/assets/javascripts/gremien.js.coffee
Normal file
3
app/assets/javascripts/gremien.js.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
||||
3
app/assets/javascripts/memberships.js.coffee
Normal file
3
app/assets/javascripts/memberships.js.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
||||
3
app/assets/stylesheets/fetprofiles.css.scss
Normal file
3
app/assets/stylesheets/fetprofiles.css.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the fetprofiles controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
3
app/assets/stylesheets/fotos.css.scss
Normal file
3
app/assets/stylesheets/fotos.css.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the fotos controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
3
app/assets/stylesheets/galleries.css.scss
Normal file
3
app/assets/stylesheets/galleries.css.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the galleries controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
3
app/assets/stylesheets/gremien.css.scss
Normal file
3
app/assets/stylesheets/gremien.css.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the gremien controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
3
app/assets/stylesheets/memberships.css.scss
Normal file
3
app/assets/stylesheets/memberships.css.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the memberships controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
83
app/controllers/fetprofiles_controller.rb
Normal file
83
app/controllers/fetprofiles_controller.rb
Normal file
@@ -0,0 +1,83 @@
|
||||
class FetprofilesController < ApplicationController
|
||||
# GET /fetprofiles
|
||||
# GET /fetprofiles.json
|
||||
def index
|
||||
@fetprofiles = Fetprofile.all
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @fetprofiles }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /fetprofiles/1
|
||||
# GET /fetprofiles/1.json
|
||||
def show
|
||||
@fetprofile = Fetprofile.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.json { render json: @fetprofile }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /fetprofiles/new
|
||||
# GET /fetprofiles/new.json
|
||||
def new
|
||||
@fetprofile = Fetprofile.new
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.json { render json: @fetprofile }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /fetprofiles/1/edit
|
||||
def edit
|
||||
@fetprofile = Fetprofile.find(params[:id])
|
||||
end
|
||||
|
||||
# POST /fetprofiles
|
||||
# POST /fetprofiles.json
|
||||
def create
|
||||
@fetprofile = Fetprofile.new(params[:fetprofile])
|
||||
|
||||
respond_to do |format|
|
||||
if @fetprofile.save
|
||||
format.html { redirect_to @fetprofile, notice: 'Fetprofile was successfully created.' }
|
||||
format.json { render json: @fetprofile, status: :created, location: @fetprofile }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.json { render json: @fetprofile.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /fetprofiles/1
|
||||
# PUT /fetprofiles/1.json
|
||||
def update
|
||||
@fetprofile = Fetprofile.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @fetprofile.update_attributes(params[:fetprofile])
|
||||
format.html { redirect_to @fetprofile, notice: 'Fetprofile was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
format.json { render json: @fetprofile.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /fetprofiles/1
|
||||
# DELETE /fetprofiles/1.json
|
||||
def destroy
|
||||
@fetprofile = Fetprofile.find(params[:id])
|
||||
@fetprofile.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to fetprofiles_url }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
end
|
||||
83
app/controllers/fotos_controller.rb
Normal file
83
app/controllers/fotos_controller.rb
Normal file
@@ -0,0 +1,83 @@
|
||||
class FotosController < ApplicationController
|
||||
# GET /fotos
|
||||
# GET /fotos.json
|
||||
def index
|
||||
@fotos = Foto.all
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @fotos }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /fotos/1
|
||||
# GET /fotos/1.json
|
||||
def show
|
||||
@foto = Foto.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.json { render json: @foto }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /fotos/new
|
||||
# GET /fotos/new.json
|
||||
def new
|
||||
@foto = Foto.new
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.json { render json: @foto }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /fotos/1/edit
|
||||
def edit
|
||||
@foto = Foto.find(params[:id])
|
||||
end
|
||||
|
||||
# POST /fotos
|
||||
# POST /fotos.json
|
||||
def create
|
||||
@foto = Foto.new(params[:foto])
|
||||
|
||||
respond_to do |format|
|
||||
if @foto.save
|
||||
format.html { redirect_to @foto, notice: 'Foto was successfully created.' }
|
||||
format.json { render json: @foto, status: :created, location: @foto }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.json { render json: @foto.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /fotos/1
|
||||
# PUT /fotos/1.json
|
||||
def update
|
||||
@foto = Foto.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @foto.update_attributes(params[:foto])
|
||||
format.html { redirect_to @foto, notice: 'Foto was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
format.json { render json: @foto.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /fotos/1
|
||||
# DELETE /fotos/1.json
|
||||
def destroy
|
||||
@foto = Foto.find(params[:id])
|
||||
@foto.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to fotos_url }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
end
|
||||
83
app/controllers/galleries_controller.rb
Normal file
83
app/controllers/galleries_controller.rb
Normal file
@@ -0,0 +1,83 @@
|
||||
class GalleriesController < ApplicationController
|
||||
# GET /galleries
|
||||
# GET /galleries.json
|
||||
def index
|
||||
@galleries = Gallery.all
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @galleries }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /galleries/1
|
||||
# GET /galleries/1.json
|
||||
def show
|
||||
@gallery = Gallery.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.json { render json: @gallery }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /galleries/new
|
||||
# GET /galleries/new.json
|
||||
def new
|
||||
@gallery = Gallery.new
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.json { render json: @gallery }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /galleries/1/edit
|
||||
def edit
|
||||
@gallery = Gallery.find(params[:id])
|
||||
end
|
||||
|
||||
# POST /galleries
|
||||
# POST /galleries.json
|
||||
def create
|
||||
@gallery = Gallery.new(params[:gallery])
|
||||
|
||||
respond_to do |format|
|
||||
if @gallery.save
|
||||
format.html { redirect_to @gallery, notice: 'Gallery was successfully created.' }
|
||||
format.json { render json: @gallery, status: :created, location: @gallery }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.json { render json: @gallery.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /galleries/1
|
||||
# PUT /galleries/1.json
|
||||
def update
|
||||
@gallery = Gallery.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @gallery.update_attributes(params[:gallery])
|
||||
format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
format.json { render json: @gallery.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /galleries/1
|
||||
# DELETE /galleries/1.json
|
||||
def destroy
|
||||
@gallery = Gallery.find(params[:id])
|
||||
@gallery.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to galleries_url }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
end
|
||||
83
app/controllers/gremien_controller.rb
Normal file
83
app/controllers/gremien_controller.rb
Normal file
@@ -0,0 +1,83 @@
|
||||
class GremienController < ApplicationController
|
||||
# GET /gremien
|
||||
# GET /gremien.json
|
||||
def index
|
||||
@gremien = Gremium.all
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @gremien }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /gremien/1
|
||||
# GET /gremien/1.json
|
||||
def show
|
||||
@gremium = Gremium.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.json { render json: @gremium }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /gremien/new
|
||||
# GET /gremien/new.json
|
||||
def new
|
||||
@gremium = Gremium.new
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.json { render json: @gremium }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /gremien/1/edit
|
||||
def edit
|
||||
@gremium = Gremium.find(params[:id])
|
||||
end
|
||||
|
||||
# POST /gremien
|
||||
# POST /gremien.json
|
||||
def create
|
||||
@gremium = Gremium.new(params[:gremium])
|
||||
|
||||
respond_to do |format|
|
||||
if @gremium.save
|
||||
format.html { redirect_to @gremium, notice: 'Gremium was successfully created.' }
|
||||
format.json { render json: @gremium, status: :created, location: @gremium }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.json { render json: @gremium.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /gremien/1
|
||||
# PUT /gremien/1.json
|
||||
def update
|
||||
@gremium = Gremium.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @gremium.update_attributes(params[:gremium])
|
||||
format.html { redirect_to @gremium, notice: 'Gremium was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
format.json { render json: @gremium.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /gremien/1
|
||||
# DELETE /gremien/1.json
|
||||
def destroy
|
||||
@gremium = Gremium.find(params[:id])
|
||||
@gremium.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to gremien_url }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
end
|
||||
83
app/controllers/memberships_controller.rb
Normal file
83
app/controllers/memberships_controller.rb
Normal file
@@ -0,0 +1,83 @@
|
||||
class MembershipsController < ApplicationController
|
||||
# GET /memberships
|
||||
# GET /memberships.json
|
||||
def index
|
||||
@memberships = Membership.all
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @memberships }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /memberships/1
|
||||
# GET /memberships/1.json
|
||||
def show
|
||||
@membership = Membership.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.json { render json: @membership }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /memberships/new
|
||||
# GET /memberships/new.json
|
||||
def new
|
||||
@membership = Membership.new
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.json { render json: @membership }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /memberships/1/edit
|
||||
def edit
|
||||
@membership = Membership.find(params[:id])
|
||||
end
|
||||
|
||||
# POST /memberships
|
||||
# POST /memberships.json
|
||||
def create
|
||||
@membership = Membership.new(params[:membership])
|
||||
|
||||
respond_to do |format|
|
||||
if @membership.save
|
||||
format.html { redirect_to @membership, notice: 'Membership was successfully created.' }
|
||||
format.json { render json: @membership, status: :created, location: @membership }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.json { render json: @membership.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /memberships/1
|
||||
# PUT /memberships/1.json
|
||||
def update
|
||||
@membership = Membership.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @membership.update_attributes(params[:membership])
|
||||
format.html { redirect_to @membership, notice: 'Membership was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
format.json { render json: @membership.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /memberships/1
|
||||
# DELETE /memberships/1.json
|
||||
def destroy
|
||||
@membership = Membership.find(params[:id])
|
||||
@membership.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to memberships_url }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
end
|
||||
2
app/helpers/fetprofiles_helper.rb
Normal file
2
app/helpers/fetprofiles_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module FetprofilesHelper
|
||||
end
|
||||
2
app/helpers/fotos_helper.rb
Normal file
2
app/helpers/fotos_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module FotosHelper
|
||||
end
|
||||
2
app/helpers/galleries_helper.rb
Normal file
2
app/helpers/galleries_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module GalleriesHelper
|
||||
end
|
||||
2
app/helpers/gremien_helper.rb
Normal file
2
app/helpers/gremien_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module GremienHelper
|
||||
end
|
||||
2
app/helpers/memberships_helper.rb
Normal file
2
app/helpers/memberships_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module MembershipsHelper
|
||||
end
|
||||
3
app/models/fetprofile.rb
Normal file
3
app/models/fetprofile.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
class Fetprofile < ActiveRecord::Base
|
||||
attr_accessible :active, :desc, :fetmailalias, :nachname, :picture, :short, :vorname
|
||||
end
|
||||
3
app/models/foto.rb
Normal file
3
app/models/foto.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
class Foto < ActiveRecord::Base
|
||||
attr_accessible :datei, :desc, :gallery_id, :title
|
||||
end
|
||||
3
app/models/gallery.rb
Normal file
3
app/models/gallery.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
class Gallery < ActiveRecord::Base
|
||||
attr_accessible :datum, :desc, :name
|
||||
end
|
||||
3
app/models/gremium.rb
Normal file
3
app/models/gremium.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
class Gremium < ActiveRecord::Base
|
||||
attr_accessible :desc, :name, :typ
|
||||
end
|
||||
3
app/models/membership.rb
Normal file
3
app/models/membership.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
class Membership < ActiveRecord::Base
|
||||
attr_accessible :fetprofile_id, :gremium_id, :start, :stop, :typ
|
||||
end
|
||||
15
app/views/fetprofiles/_form.html.erb
Normal file
15
app/views/fetprofiles/_form.html.erb
Normal file
@@ -0,0 +1,15 @@
|
||||
<%= semantic_form_for @fetprofile do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :vorname %>
|
||||
<%= f.input :nachname %>
|
||||
<%= f.input :short %>
|
||||
<%= f.input :fetmailalias %>
|
||||
<%= f.input :desc %>
|
||||
<%= f.input :picture %>
|
||||
<%= f.input :active %>
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :input %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
6
app/views/fetprofiles/edit.html.erb
Normal file
6
app/views/fetprofiles/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing fetprofile</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @fetprofile %> |
|
||||
<%= link_to 'Back', fetprofiles_path %>
|
||||
35
app/views/fetprofiles/index.html.erb
Normal file
35
app/views/fetprofiles/index.html.erb
Normal file
@@ -0,0 +1,35 @@
|
||||
<h1>Listing fetprofiles</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Vorname</th>
|
||||
<th>Nachname</th>
|
||||
<th>Short</th>
|
||||
<th>Fetmailalias</th>
|
||||
<th>Desc</th>
|
||||
<th>Picture</th>
|
||||
<th>Active</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @fetprofiles.each do |fetprofile| %>
|
||||
<tr>
|
||||
<td><%= fetprofile.vorname %></td>
|
||||
<td><%= fetprofile.nachname %></td>
|
||||
<td><%= fetprofile.short %></td>
|
||||
<td><%= fetprofile.fetmailalias %></td>
|
||||
<td><%= fetprofile.desc %></td>
|
||||
<td><%= fetprofile.picture %></td>
|
||||
<td><%= fetprofile.active %></td>
|
||||
<td><%= link_to 'Show', fetprofile %></td>
|
||||
<td><%= link_to 'Edit', edit_fetprofile_path(fetprofile) %></td>
|
||||
<td><%= link_to 'Destroy', fetprofile, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New Fetprofile', new_fetprofile_path %>
|
||||
5
app/views/fetprofiles/new.html.erb
Normal file
5
app/views/fetprofiles/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New fetprofile</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', fetprofiles_path %>
|
||||
40
app/views/fetprofiles/show.html.erb
Normal file
40
app/views/fetprofiles/show.html.erb
Normal file
@@ -0,0 +1,40 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<b>Vorname:</b>
|
||||
<%= @fetprofile.vorname %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Nachname:</b>
|
||||
<%= @fetprofile.nachname %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Short:</b>
|
||||
<%= @fetprofile.short %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Fetmailalias:</b>
|
||||
<%= @fetprofile.fetmailalias %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Desc:</b>
|
||||
<%= @fetprofile.desc %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Picture:</b>
|
||||
<%= @fetprofile.picture %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Active:</b>
|
||||
<%= @fetprofile.active %>
|
||||
</p>
|
||||
|
||||
|
||||
<%= link_to 'Edit', edit_fetprofile_path(@fetprofile) %> |
|
||||
<%= link_to 'Back', fetprofiles_path %>
|
||||
12
app/views/fotos/_form.html.erb
Normal file
12
app/views/fotos/_form.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<%= semantic_form_for @foto do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :title %>
|
||||
<%= f.input :desc %>
|
||||
<%= f.input :gallery_id %>
|
||||
<%= f.input :datei %>
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :input %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
6
app/views/fotos/edit.html.erb
Normal file
6
app/views/fotos/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing foto</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @foto %> |
|
||||
<%= link_to 'Back', fotos_path %>
|
||||
29
app/views/fotos/index.html.erb
Normal file
29
app/views/fotos/index.html.erb
Normal file
@@ -0,0 +1,29 @@
|
||||
<h1>Listing fotos</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<th>Desc</th>
|
||||
<th>Gallery</th>
|
||||
<th>Datei</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @fotos.each do |foto| %>
|
||||
<tr>
|
||||
<td><%= foto.title %></td>
|
||||
<td><%= foto.desc %></td>
|
||||
<td><%= foto.gallery_id %></td>
|
||||
<td><%= foto.datei %></td>
|
||||
<td><%= link_to 'Show', foto %></td>
|
||||
<td><%= link_to 'Edit', edit_foto_path(foto) %></td>
|
||||
<td><%= link_to 'Destroy', foto, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New Foto', new_foto_path %>
|
||||
5
app/views/fotos/new.html.erb
Normal file
5
app/views/fotos/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New foto</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', fotos_path %>
|
||||
25
app/views/fotos/show.html.erb
Normal file
25
app/views/fotos/show.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<b>Title:</b>
|
||||
<%= @foto.title %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Desc:</b>
|
||||
<%= @foto.desc %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Gallery:</b>
|
||||
<%= @foto.gallery_id %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Datei:</b>
|
||||
<%= @foto.datei %>
|
||||
</p>
|
||||
|
||||
|
||||
<%= link_to 'Edit', edit_foto_path(@foto) %> |
|
||||
<%= link_to 'Back', fotos_path %>
|
||||
11
app/views/galleries/_form.html.erb
Normal file
11
app/views/galleries/_form.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<%= semantic_form_for @gallery do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :desc %>
|
||||
<%= f.input :datum %>
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :input %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
6
app/views/galleries/edit.html.erb
Normal file
6
app/views/galleries/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing gallery</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @gallery %> |
|
||||
<%= link_to 'Back', galleries_path %>
|
||||
27
app/views/galleries/index.html.erb
Normal file
27
app/views/galleries/index.html.erb
Normal file
@@ -0,0 +1,27 @@
|
||||
<h1>Listing galleries</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Desc</th>
|
||||
<th>Datum</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @galleries.each do |gallery| %>
|
||||
<tr>
|
||||
<td><%= gallery.name %></td>
|
||||
<td><%= gallery.desc %></td>
|
||||
<td><%= gallery.datum %></td>
|
||||
<td><%= link_to 'Show', gallery %></td>
|
||||
<td><%= link_to 'Edit', edit_gallery_path(gallery) %></td>
|
||||
<td><%= link_to 'Destroy', gallery, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New Gallery', new_gallery_path %>
|
||||
5
app/views/galleries/new.html.erb
Normal file
5
app/views/galleries/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New gallery</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', galleries_path %>
|
||||
20
app/views/galleries/show.html.erb
Normal file
20
app/views/galleries/show.html.erb
Normal file
@@ -0,0 +1,20 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<b>Name:</b>
|
||||
<%= @gallery.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Desc:</b>
|
||||
<%= @gallery.desc %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Datum:</b>
|
||||
<%= @gallery.datum %>
|
||||
</p>
|
||||
|
||||
|
||||
<%= link_to 'Edit', edit_gallery_path(@gallery) %> |
|
||||
<%= link_to 'Back', galleries_path %>
|
||||
11
app/views/gremien/_form.html.erb
Normal file
11
app/views/gremien/_form.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<%= semantic_form_for @gremium do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :desc %>
|
||||
<%= f.input :typ %>
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :input %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
6
app/views/gremien/edit.html.erb
Normal file
6
app/views/gremien/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing gremium</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @gremium %> |
|
||||
<%= link_to 'Back', gremien_path %>
|
||||
27
app/views/gremien/index.html.erb
Normal file
27
app/views/gremien/index.html.erb
Normal file
@@ -0,0 +1,27 @@
|
||||
<h1>Listing gremien</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Desc</th>
|
||||
<th>Typ</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @gremien.each do |gremium| %>
|
||||
<tr>
|
||||
<td><%= gremium.name %></td>
|
||||
<td><%= gremium.desc %></td>
|
||||
<td><%= gremium.typ %></td>
|
||||
<td><%= link_to 'Show', gremium %></td>
|
||||
<td><%= link_to 'Edit', edit_gremium_path(gremium) %></td>
|
||||
<td><%= link_to 'Destroy', gremium, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New Gremium', new_gremium_path %>
|
||||
5
app/views/gremien/new.html.erb
Normal file
5
app/views/gremien/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New gremium</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', gremien_path %>
|
||||
20
app/views/gremien/show.html.erb
Normal file
20
app/views/gremien/show.html.erb
Normal file
@@ -0,0 +1,20 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<b>Name:</b>
|
||||
<%= @gremium.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Desc:</b>
|
||||
<%= @gremium.desc %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Typ:</b>
|
||||
<%= @gremium.typ %>
|
||||
</p>
|
||||
|
||||
|
||||
<%= link_to 'Edit', edit_gremium_path(@gremium) %> |
|
||||
<%= link_to 'Back', gremien_path %>
|
||||
13
app/views/memberships/_form.html.erb
Normal file
13
app/views/memberships/_form.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%= semantic_form_for @membership do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :fetprofile_id %>
|
||||
<%= f.input :gremium_id %>
|
||||
<%= f.input :start %>
|
||||
<%= f.input :stop %>
|
||||
<%= f.input :typ %>
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :input %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
6
app/views/memberships/edit.html.erb
Normal file
6
app/views/memberships/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing membership</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @membership %> |
|
||||
<%= link_to 'Back', memberships_path %>
|
||||
31
app/views/memberships/index.html.erb
Normal file
31
app/views/memberships/index.html.erb
Normal file
@@ -0,0 +1,31 @@
|
||||
<h1>Listing memberships</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Fetprofile</th>
|
||||
<th>Gremium</th>
|
||||
<th>Start</th>
|
||||
<th>Stop</th>
|
||||
<th>Typ</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @memberships.each do |membership| %>
|
||||
<tr>
|
||||
<td><%= membership.fetprofile_id %></td>
|
||||
<td><%= membership.gremium_id %></td>
|
||||
<td><%= membership.start %></td>
|
||||
<td><%= membership.stop %></td>
|
||||
<td><%= membership.typ %></td>
|
||||
<td><%= link_to 'Show', membership %></td>
|
||||
<td><%= link_to 'Edit', edit_membership_path(membership) %></td>
|
||||
<td><%= link_to 'Destroy', membership, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New Membership', new_membership_path %>
|
||||
5
app/views/memberships/new.html.erb
Normal file
5
app/views/memberships/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New membership</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', memberships_path %>
|
||||
30
app/views/memberships/show.html.erb
Normal file
30
app/views/memberships/show.html.erb
Normal file
@@ -0,0 +1,30 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<b>Fetprofile:</b>
|
||||
<%= @membership.fetprofile_id %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Gremium:</b>
|
||||
<%= @membership.gremium_id %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Start:</b>
|
||||
<%= @membership.start %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Stop:</b>
|
||||
<%= @membership.stop %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Typ:</b>
|
||||
<%= @membership.typ %>
|
||||
</p>
|
||||
|
||||
|
||||
<%= link_to 'Edit', edit_membership_path(@membership) %> |
|
||||
<%= link_to 'Back', memberships_path %>
|
||||
@@ -34,4 +34,8 @@ inflect.irregular 'thema', 'themen'
|
||||
inflect.plural 'frage', 'fragen'
|
||||
inflect.singular 'fragen', 'frage'
|
||||
inflect.irregular 'frage', 'fragen'
|
||||
inflect.singular 'gremien', 'gremium'
|
||||
inflect.irregular 'gremium', 'gremien'
|
||||
inflect.plural 'gremium', 'gremien'
|
||||
|
||||
end
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
Fetsite::Application.routes.draw do
|
||||
|
||||
resources :fotos
|
||||
|
||||
|
||||
resources :galleries
|
||||
|
||||
|
||||
resources :memberships
|
||||
|
||||
|
||||
resources :gremien
|
||||
|
||||
|
||||
resources :fetprofiles
|
||||
|
||||
|
||||
devise_for :users
|
||||
resources :home, :only=>[:index]
|
||||
#get 'home',:controller=>home,:action=>:index,:as=>"home_index"
|
||||
|
||||
15
db/migrate/20130819133257_create_fetprofiles.rb
Normal file
15
db/migrate/20130819133257_create_fetprofiles.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class CreateFetprofiles < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :fetprofiles do |t|
|
||||
t.string :vorname
|
||||
t.string :nachname
|
||||
t.string :short
|
||||
t.string :fetmailalias
|
||||
t.text :desc
|
||||
t.string :picture
|
||||
t.boolean :active
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/migrate/20130819133330_create_gremien.rb
Normal file
11
db/migrate/20130819133330_create_gremien.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateGremien < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :gremien do |t|
|
||||
t.string :name
|
||||
t.text :desc
|
||||
t.string :typ
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
13
db/migrate/20130819133446_create_memberships.rb
Normal file
13
db/migrate/20130819133446_create_memberships.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class CreateMemberships < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :memberships do |t|
|
||||
t.string :fetprofile_id
|
||||
t.string :gremium_id
|
||||
t.date :start
|
||||
t.date :stop
|
||||
t.string :typ
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/migrate/20130819133607_create_galleries.rb
Normal file
11
db/migrate/20130819133607_create_galleries.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateGalleries < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :galleries do |t|
|
||||
t.string :name
|
||||
t.text :desc
|
||||
t.date :datum
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
12
db/migrate/20130819133729_create_fotos.rb
Normal file
12
db/migrate/20130819133729_create_fotos.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class CreateFotos < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :fotos do |t|
|
||||
t.string :title
|
||||
t.text :desc
|
||||
t.integer :gallery_id
|
||||
t.string :datei
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
160
spec/controllers/fetprofiles_controller_spec.rb
Normal file
160
spec/controllers/fetprofiles_controller_spec.rb
Normal file
@@ -0,0 +1,160 @@
|
||||
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 FetprofilesController do
|
||||
|
||||
# This should return the minimal set of attributes required to create a valid
|
||||
# Fetprofile. As you add validations to Fetprofile, be sure to
|
||||
# adjust the attributes here as well.
|
||||
let(:valid_attributes) { { "vorname" => "MyString" } }
|
||||
|
||||
# This should return the minimal set of values that should be in the session
|
||||
# in order to pass any filters (e.g. authentication) defined in
|
||||
# FetprofilesController. Be sure to keep this updated too.
|
||||
let(:valid_session) { {} }
|
||||
|
||||
describe "GET index" do
|
||||
it "assigns all fetprofiles as @fetprofiles" do
|
||||
fetprofile = Fetprofile.create! valid_attributes
|
||||
get :index, {}, valid_session
|
||||
assigns(:fetprofiles).should eq([fetprofile])
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET show" do
|
||||
it "assigns the requested fetprofile as @fetprofile" do
|
||||
fetprofile = Fetprofile.create! valid_attributes
|
||||
get :show, {:id => fetprofile.to_param}, valid_session
|
||||
assigns(:fetprofile).should eq(fetprofile)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET new" do
|
||||
it "assigns a new fetprofile as @fetprofile" do
|
||||
get :new, {}, valid_session
|
||||
assigns(:fetprofile).should be_a_new(Fetprofile)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET edit" do
|
||||
it "assigns the requested fetprofile as @fetprofile" do
|
||||
fetprofile = Fetprofile.create! valid_attributes
|
||||
get :edit, {:id => fetprofile.to_param}, valid_session
|
||||
assigns(:fetprofile).should eq(fetprofile)
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST create" do
|
||||
describe "with valid params" do
|
||||
it "creates a new Fetprofile" do
|
||||
expect {
|
||||
post :create, {:fetprofile => valid_attributes}, valid_session
|
||||
}.to change(Fetprofile, :count).by(1)
|
||||
end
|
||||
|
||||
it "assigns a newly created fetprofile as @fetprofile" do
|
||||
post :create, {:fetprofile => valid_attributes}, valid_session
|
||||
assigns(:fetprofile).should be_a(Fetprofile)
|
||||
assigns(:fetprofile).should be_persisted
|
||||
end
|
||||
|
||||
it "redirects to the created fetprofile" do
|
||||
post :create, {:fetprofile => valid_attributes}, valid_session
|
||||
response.should redirect_to(Fetprofile.last)
|
||||
end
|
||||
end
|
||||
|
||||
describe "with invalid params" do
|
||||
it "assigns a newly created but unsaved fetprofile as @fetprofile" do
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Fetprofile.any_instance.stub(:save).and_return(false)
|
||||
post :create, {:fetprofile => { "vorname" => "invalid value" }}, valid_session
|
||||
assigns(:fetprofile).should be_a_new(Fetprofile)
|
||||
end
|
||||
|
||||
it "re-renders the 'new' template" do
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Fetprofile.any_instance.stub(:save).and_return(false)
|
||||
post :create, {:fetprofile => { "vorname" => "invalid value" }}, valid_session
|
||||
response.should render_template("new")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT update" do
|
||||
describe "with valid params" do
|
||||
it "updates the requested fetprofile" do
|
||||
fetprofile = Fetprofile.create! valid_attributes
|
||||
# Assuming there are no other fetprofiles in the database, this
|
||||
# specifies that the Fetprofile created on the previous line
|
||||
# receives the :update_attributes message with whatever params are
|
||||
# submitted in the request.
|
||||
Fetprofile.any_instance.should_receive(:update_attributes).with({ "vorname" => "MyString" })
|
||||
put :update, {:id => fetprofile.to_param, :fetprofile => { "vorname" => "MyString" }}, valid_session
|
||||
end
|
||||
|
||||
it "assigns the requested fetprofile as @fetprofile" do
|
||||
fetprofile = Fetprofile.create! valid_attributes
|
||||
put :update, {:id => fetprofile.to_param, :fetprofile => valid_attributes}, valid_session
|
||||
assigns(:fetprofile).should eq(fetprofile)
|
||||
end
|
||||
|
||||
it "redirects to the fetprofile" do
|
||||
fetprofile = Fetprofile.create! valid_attributes
|
||||
put :update, {:id => fetprofile.to_param, :fetprofile => valid_attributes}, valid_session
|
||||
response.should redirect_to(fetprofile)
|
||||
end
|
||||
end
|
||||
|
||||
describe "with invalid params" do
|
||||
it "assigns the fetprofile as @fetprofile" do
|
||||
fetprofile = Fetprofile.create! valid_attributes
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Fetprofile.any_instance.stub(:save).and_return(false)
|
||||
put :update, {:id => fetprofile.to_param, :fetprofile => { "vorname" => "invalid value" }}, valid_session
|
||||
assigns(:fetprofile).should eq(fetprofile)
|
||||
end
|
||||
|
||||
it "re-renders the 'edit' template" do
|
||||
fetprofile = Fetprofile.create! valid_attributes
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Fetprofile.any_instance.stub(:save).and_return(false)
|
||||
put :update, {:id => fetprofile.to_param, :fetprofile => { "vorname" => "invalid value" }}, valid_session
|
||||
response.should render_template("edit")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE destroy" do
|
||||
it "destroys the requested fetprofile" do
|
||||
fetprofile = Fetprofile.create! valid_attributes
|
||||
expect {
|
||||
delete :destroy, {:id => fetprofile.to_param}, valid_session
|
||||
}.to change(Fetprofile, :count).by(-1)
|
||||
end
|
||||
|
||||
it "redirects to the fetprofiles list" do
|
||||
fetprofile = Fetprofile.create! valid_attributes
|
||||
delete :destroy, {:id => fetprofile.to_param}, valid_session
|
||||
response.should redirect_to(fetprofiles_url)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
160
spec/controllers/fotos_controller_spec.rb
Normal file
160
spec/controllers/fotos_controller_spec.rb
Normal file
@@ -0,0 +1,160 @@
|
||||
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 FotosController do
|
||||
|
||||
# This should return the minimal set of attributes required to create a valid
|
||||
# Foto. As you add validations to Foto, be sure to
|
||||
# adjust the attributes here as well.
|
||||
let(:valid_attributes) { { "title" => "MyString" } }
|
||||
|
||||
# This should return the minimal set of values that should be in the session
|
||||
# in order to pass any filters (e.g. authentication) defined in
|
||||
# FotosController. Be sure to keep this updated too.
|
||||
let(:valid_session) { {} }
|
||||
|
||||
describe "GET index" do
|
||||
it "assigns all fotos as @fotos" do
|
||||
foto = Foto.create! valid_attributes
|
||||
get :index, {}, valid_session
|
||||
assigns(:fotos).should eq([foto])
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET show" do
|
||||
it "assigns the requested foto as @foto" do
|
||||
foto = Foto.create! valid_attributes
|
||||
get :show, {:id => foto.to_param}, valid_session
|
||||
assigns(:foto).should eq(foto)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET new" do
|
||||
it "assigns a new foto as @foto" do
|
||||
get :new, {}, valid_session
|
||||
assigns(:foto).should be_a_new(Foto)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET edit" do
|
||||
it "assigns the requested foto as @foto" do
|
||||
foto = Foto.create! valid_attributes
|
||||
get :edit, {:id => foto.to_param}, valid_session
|
||||
assigns(:foto).should eq(foto)
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST create" do
|
||||
describe "with valid params" do
|
||||
it "creates a new Foto" do
|
||||
expect {
|
||||
post :create, {:foto => valid_attributes}, valid_session
|
||||
}.to change(Foto, :count).by(1)
|
||||
end
|
||||
|
||||
it "assigns a newly created foto as @foto" do
|
||||
post :create, {:foto => valid_attributes}, valid_session
|
||||
assigns(:foto).should be_a(Foto)
|
||||
assigns(:foto).should be_persisted
|
||||
end
|
||||
|
||||
it "redirects to the created foto" do
|
||||
post :create, {:foto => valid_attributes}, valid_session
|
||||
response.should redirect_to(Foto.last)
|
||||
end
|
||||
end
|
||||
|
||||
describe "with invalid params" do
|
||||
it "assigns a newly created but unsaved foto as @foto" do
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Foto.any_instance.stub(:save).and_return(false)
|
||||
post :create, {:foto => { "title" => "invalid value" }}, valid_session
|
||||
assigns(:foto).should be_a_new(Foto)
|
||||
end
|
||||
|
||||
it "re-renders the 'new' template" do
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Foto.any_instance.stub(:save).and_return(false)
|
||||
post :create, {:foto => { "title" => "invalid value" }}, valid_session
|
||||
response.should render_template("new")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT update" do
|
||||
describe "with valid params" do
|
||||
it "updates the requested foto" do
|
||||
foto = Foto.create! valid_attributes
|
||||
# Assuming there are no other fotos in the database, this
|
||||
# specifies that the Foto created on the previous line
|
||||
# receives the :update_attributes message with whatever params are
|
||||
# submitted in the request.
|
||||
Foto.any_instance.should_receive(:update_attributes).with({ "title" => "MyString" })
|
||||
put :update, {:id => foto.to_param, :foto => { "title" => "MyString" }}, valid_session
|
||||
end
|
||||
|
||||
it "assigns the requested foto as @foto" do
|
||||
foto = Foto.create! valid_attributes
|
||||
put :update, {:id => foto.to_param, :foto => valid_attributes}, valid_session
|
||||
assigns(:foto).should eq(foto)
|
||||
end
|
||||
|
||||
it "redirects to the foto" do
|
||||
foto = Foto.create! valid_attributes
|
||||
put :update, {:id => foto.to_param, :foto => valid_attributes}, valid_session
|
||||
response.should redirect_to(foto)
|
||||
end
|
||||
end
|
||||
|
||||
describe "with invalid params" do
|
||||
it "assigns the foto as @foto" do
|
||||
foto = Foto.create! valid_attributes
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Foto.any_instance.stub(:save).and_return(false)
|
||||
put :update, {:id => foto.to_param, :foto => { "title" => "invalid value" }}, valid_session
|
||||
assigns(:foto).should eq(foto)
|
||||
end
|
||||
|
||||
it "re-renders the 'edit' template" do
|
||||
foto = Foto.create! valid_attributes
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Foto.any_instance.stub(:save).and_return(false)
|
||||
put :update, {:id => foto.to_param, :foto => { "title" => "invalid value" }}, valid_session
|
||||
response.should render_template("edit")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE destroy" do
|
||||
it "destroys the requested foto" do
|
||||
foto = Foto.create! valid_attributes
|
||||
expect {
|
||||
delete :destroy, {:id => foto.to_param}, valid_session
|
||||
}.to change(Foto, :count).by(-1)
|
||||
end
|
||||
|
||||
it "redirects to the fotos list" do
|
||||
foto = Foto.create! valid_attributes
|
||||
delete :destroy, {:id => foto.to_param}, valid_session
|
||||
response.should redirect_to(fotos_url)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
160
spec/controllers/galleries_controller_spec.rb
Normal file
160
spec/controllers/galleries_controller_spec.rb
Normal file
@@ -0,0 +1,160 @@
|
||||
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 GalleriesController do
|
||||
|
||||
# This should return the minimal set of attributes required to create a valid
|
||||
# Gallery. As you add validations to Gallery, be sure to
|
||||
# adjust the attributes here as well.
|
||||
let(:valid_attributes) { { "name" => "MyString" } }
|
||||
|
||||
# This should return the minimal set of values that should be in the session
|
||||
# in order to pass any filters (e.g. authentication) defined in
|
||||
# GalleriesController. Be sure to keep this updated too.
|
||||
let(:valid_session) { {} }
|
||||
|
||||
describe "GET index" do
|
||||
it "assigns all galleries as @galleries" do
|
||||
gallery = Gallery.create! valid_attributes
|
||||
get :index, {}, valid_session
|
||||
assigns(:galleries).should eq([gallery])
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET show" do
|
||||
it "assigns the requested gallery as @gallery" do
|
||||
gallery = Gallery.create! valid_attributes
|
||||
get :show, {:id => gallery.to_param}, valid_session
|
||||
assigns(:gallery).should eq(gallery)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET new" do
|
||||
it "assigns a new gallery as @gallery" do
|
||||
get :new, {}, valid_session
|
||||
assigns(:gallery).should be_a_new(Gallery)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET edit" do
|
||||
it "assigns the requested gallery as @gallery" do
|
||||
gallery = Gallery.create! valid_attributes
|
||||
get :edit, {:id => gallery.to_param}, valid_session
|
||||
assigns(:gallery).should eq(gallery)
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST create" do
|
||||
describe "with valid params" do
|
||||
it "creates a new Gallery" do
|
||||
expect {
|
||||
post :create, {:gallery => valid_attributes}, valid_session
|
||||
}.to change(Gallery, :count).by(1)
|
||||
end
|
||||
|
||||
it "assigns a newly created gallery as @gallery" do
|
||||
post :create, {:gallery => valid_attributes}, valid_session
|
||||
assigns(:gallery).should be_a(Gallery)
|
||||
assigns(:gallery).should be_persisted
|
||||
end
|
||||
|
||||
it "redirects to the created gallery" do
|
||||
post :create, {:gallery => valid_attributes}, valid_session
|
||||
response.should redirect_to(Gallery.last)
|
||||
end
|
||||
end
|
||||
|
||||
describe "with invalid params" do
|
||||
it "assigns a newly created but unsaved gallery as @gallery" do
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Gallery.any_instance.stub(:save).and_return(false)
|
||||
post :create, {:gallery => { "name" => "invalid value" }}, valid_session
|
||||
assigns(:gallery).should be_a_new(Gallery)
|
||||
end
|
||||
|
||||
it "re-renders the 'new' template" do
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Gallery.any_instance.stub(:save).and_return(false)
|
||||
post :create, {:gallery => { "name" => "invalid value" }}, valid_session
|
||||
response.should render_template("new")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT update" do
|
||||
describe "with valid params" do
|
||||
it "updates the requested gallery" do
|
||||
gallery = Gallery.create! valid_attributes
|
||||
# Assuming there are no other galleries in the database, this
|
||||
# specifies that the Gallery created on the previous line
|
||||
# receives the :update_attributes message with whatever params are
|
||||
# submitted in the request.
|
||||
Gallery.any_instance.should_receive(:update_attributes).with({ "name" => "MyString" })
|
||||
put :update, {:id => gallery.to_param, :gallery => { "name" => "MyString" }}, valid_session
|
||||
end
|
||||
|
||||
it "assigns the requested gallery as @gallery" do
|
||||
gallery = Gallery.create! valid_attributes
|
||||
put :update, {:id => gallery.to_param, :gallery => valid_attributes}, valid_session
|
||||
assigns(:gallery).should eq(gallery)
|
||||
end
|
||||
|
||||
it "redirects to the gallery" do
|
||||
gallery = Gallery.create! valid_attributes
|
||||
put :update, {:id => gallery.to_param, :gallery => valid_attributes}, valid_session
|
||||
response.should redirect_to(gallery)
|
||||
end
|
||||
end
|
||||
|
||||
describe "with invalid params" do
|
||||
it "assigns the gallery as @gallery" do
|
||||
gallery = Gallery.create! valid_attributes
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Gallery.any_instance.stub(:save).and_return(false)
|
||||
put :update, {:id => gallery.to_param, :gallery => { "name" => "invalid value" }}, valid_session
|
||||
assigns(:gallery).should eq(gallery)
|
||||
end
|
||||
|
||||
it "re-renders the 'edit' template" do
|
||||
gallery = Gallery.create! valid_attributes
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Gallery.any_instance.stub(:save).and_return(false)
|
||||
put :update, {:id => gallery.to_param, :gallery => { "name" => "invalid value" }}, valid_session
|
||||
response.should render_template("edit")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE destroy" do
|
||||
it "destroys the requested gallery" do
|
||||
gallery = Gallery.create! valid_attributes
|
||||
expect {
|
||||
delete :destroy, {:id => gallery.to_param}, valid_session
|
||||
}.to change(Gallery, :count).by(-1)
|
||||
end
|
||||
|
||||
it "redirects to the galleries list" do
|
||||
gallery = Gallery.create! valid_attributes
|
||||
delete :destroy, {:id => gallery.to_param}, valid_session
|
||||
response.should redirect_to(galleries_url)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
160
spec/controllers/gremien_controller_spec.rb
Normal file
160
spec/controllers/gremien_controller_spec.rb
Normal file
@@ -0,0 +1,160 @@
|
||||
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 GremienController do
|
||||
|
||||
# This should return the minimal set of attributes required to create a valid
|
||||
# Gremium. As you add validations to Gremium, be sure to
|
||||
# adjust the attributes here as well.
|
||||
let(:valid_attributes) { { "name" => "MyString" } }
|
||||
|
||||
# This should return the minimal set of values that should be in the session
|
||||
# in order to pass any filters (e.g. authentication) defined in
|
||||
# GremienController. Be sure to keep this updated too.
|
||||
let(:valid_session) { {} }
|
||||
|
||||
describe "GET index" do
|
||||
it "assigns all gremien as @gremien" do
|
||||
gremium = Gremium.create! valid_attributes
|
||||
get :index, {}, valid_session
|
||||
assigns(:gremien).should eq([gremium])
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET show" do
|
||||
it "assigns the requested gremium as @gremium" do
|
||||
gremium = Gremium.create! valid_attributes
|
||||
get :show, {:id => gremium.to_param}, valid_session
|
||||
assigns(:gremium).should eq(gremium)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET new" do
|
||||
it "assigns a new gremium as @gremium" do
|
||||
get :new, {}, valid_session
|
||||
assigns(:gremium).should be_a_new(Gremium)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET edit" do
|
||||
it "assigns the requested gremium as @gremium" do
|
||||
gremium = Gremium.create! valid_attributes
|
||||
get :edit, {:id => gremium.to_param}, valid_session
|
||||
assigns(:gremium).should eq(gremium)
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST create" do
|
||||
describe "with valid params" do
|
||||
it "creates a new Gremium" do
|
||||
expect {
|
||||
post :create, {:gremium => valid_attributes}, valid_session
|
||||
}.to change(Gremium, :count).by(1)
|
||||
end
|
||||
|
||||
it "assigns a newly created gremium as @gremium" do
|
||||
post :create, {:gremium => valid_attributes}, valid_session
|
||||
assigns(:gremium).should be_a(Gremium)
|
||||
assigns(:gremium).should be_persisted
|
||||
end
|
||||
|
||||
it "redirects to the created gremium" do
|
||||
post :create, {:gremium => valid_attributes}, valid_session
|
||||
response.should redirect_to(Gremium.last)
|
||||
end
|
||||
end
|
||||
|
||||
describe "with invalid params" do
|
||||
it "assigns a newly created but unsaved gremium as @gremium" do
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Gremium.any_instance.stub(:save).and_return(false)
|
||||
post :create, {:gremium => { "name" => "invalid value" }}, valid_session
|
||||
assigns(:gremium).should be_a_new(Gremium)
|
||||
end
|
||||
|
||||
it "re-renders the 'new' template" do
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Gremium.any_instance.stub(:save).and_return(false)
|
||||
post :create, {:gremium => { "name" => "invalid value" }}, valid_session
|
||||
response.should render_template("new")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT update" do
|
||||
describe "with valid params" do
|
||||
it "updates the requested gremium" do
|
||||
gremium = Gremium.create! valid_attributes
|
||||
# Assuming there are no other gremien in the database, this
|
||||
# specifies that the Gremium created on the previous line
|
||||
# receives the :update_attributes message with whatever params are
|
||||
# submitted in the request.
|
||||
Gremium.any_instance.should_receive(:update_attributes).with({ "name" => "MyString" })
|
||||
put :update, {:id => gremium.to_param, :gremium => { "name" => "MyString" }}, valid_session
|
||||
end
|
||||
|
||||
it "assigns the requested gremium as @gremium" do
|
||||
gremium = Gremium.create! valid_attributes
|
||||
put :update, {:id => gremium.to_param, :gremium => valid_attributes}, valid_session
|
||||
assigns(:gremium).should eq(gremium)
|
||||
end
|
||||
|
||||
it "redirects to the gremium" do
|
||||
gremium = Gremium.create! valid_attributes
|
||||
put :update, {:id => gremium.to_param, :gremium => valid_attributes}, valid_session
|
||||
response.should redirect_to(gremium)
|
||||
end
|
||||
end
|
||||
|
||||
describe "with invalid params" do
|
||||
it "assigns the gremium as @gremium" do
|
||||
gremium = Gremium.create! valid_attributes
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Gremium.any_instance.stub(:save).and_return(false)
|
||||
put :update, {:id => gremium.to_param, :gremium => { "name" => "invalid value" }}, valid_session
|
||||
assigns(:gremium).should eq(gremium)
|
||||
end
|
||||
|
||||
it "re-renders the 'edit' template" do
|
||||
gremium = Gremium.create! valid_attributes
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Gremium.any_instance.stub(:save).and_return(false)
|
||||
put :update, {:id => gremium.to_param, :gremium => { "name" => "invalid value" }}, valid_session
|
||||
response.should render_template("edit")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE destroy" do
|
||||
it "destroys the requested gremium" do
|
||||
gremium = Gremium.create! valid_attributes
|
||||
expect {
|
||||
delete :destroy, {:id => gremium.to_param}, valid_session
|
||||
}.to change(Gremium, :count).by(-1)
|
||||
end
|
||||
|
||||
it "redirects to the gremien list" do
|
||||
gremium = Gremium.create! valid_attributes
|
||||
delete :destroy, {:id => gremium.to_param}, valid_session
|
||||
response.should redirect_to(gremien_url)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
160
spec/controllers/memberships_controller_spec.rb
Normal file
160
spec/controllers/memberships_controller_spec.rb
Normal file
@@ -0,0 +1,160 @@
|
||||
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 MembershipsController do
|
||||
|
||||
# This should return the minimal set of attributes required to create a valid
|
||||
# Membership. As you add validations to Membership, be sure to
|
||||
# adjust the attributes here as well.
|
||||
let(:valid_attributes) { { "fetprofile_id" => "MyString" } }
|
||||
|
||||
# This should return the minimal set of values that should be in the session
|
||||
# in order to pass any filters (e.g. authentication) defined in
|
||||
# MembershipsController. Be sure to keep this updated too.
|
||||
let(:valid_session) { {} }
|
||||
|
||||
describe "GET index" do
|
||||
it "assigns all memberships as @memberships" do
|
||||
membership = Membership.create! valid_attributes
|
||||
get :index, {}, valid_session
|
||||
assigns(:memberships).should eq([membership])
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET show" do
|
||||
it "assigns the requested membership as @membership" do
|
||||
membership = Membership.create! valid_attributes
|
||||
get :show, {:id => membership.to_param}, valid_session
|
||||
assigns(:membership).should eq(membership)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET new" do
|
||||
it "assigns a new membership as @membership" do
|
||||
get :new, {}, valid_session
|
||||
assigns(:membership).should be_a_new(Membership)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET edit" do
|
||||
it "assigns the requested membership as @membership" do
|
||||
membership = Membership.create! valid_attributes
|
||||
get :edit, {:id => membership.to_param}, valid_session
|
||||
assigns(:membership).should eq(membership)
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST create" do
|
||||
describe "with valid params" do
|
||||
it "creates a new Membership" do
|
||||
expect {
|
||||
post :create, {:membership => valid_attributes}, valid_session
|
||||
}.to change(Membership, :count).by(1)
|
||||
end
|
||||
|
||||
it "assigns a newly created membership as @membership" do
|
||||
post :create, {:membership => valid_attributes}, valid_session
|
||||
assigns(:membership).should be_a(Membership)
|
||||
assigns(:membership).should be_persisted
|
||||
end
|
||||
|
||||
it "redirects to the created membership" do
|
||||
post :create, {:membership => valid_attributes}, valid_session
|
||||
response.should redirect_to(Membership.last)
|
||||
end
|
||||
end
|
||||
|
||||
describe "with invalid params" do
|
||||
it "assigns a newly created but unsaved membership as @membership" do
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Membership.any_instance.stub(:save).and_return(false)
|
||||
post :create, {:membership => { "fetprofile_id" => "invalid value" }}, valid_session
|
||||
assigns(:membership).should be_a_new(Membership)
|
||||
end
|
||||
|
||||
it "re-renders the 'new' template" do
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Membership.any_instance.stub(:save).and_return(false)
|
||||
post :create, {:membership => { "fetprofile_id" => "invalid value" }}, valid_session
|
||||
response.should render_template("new")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT update" do
|
||||
describe "with valid params" do
|
||||
it "updates the requested membership" do
|
||||
membership = Membership.create! valid_attributes
|
||||
# Assuming there are no other memberships in the database, this
|
||||
# specifies that the Membership created on the previous line
|
||||
# receives the :update_attributes message with whatever params are
|
||||
# submitted in the request.
|
||||
Membership.any_instance.should_receive(:update_attributes).with({ "fetprofile_id" => "MyString" })
|
||||
put :update, {:id => membership.to_param, :membership => { "fetprofile_id" => "MyString" }}, valid_session
|
||||
end
|
||||
|
||||
it "assigns the requested membership as @membership" do
|
||||
membership = Membership.create! valid_attributes
|
||||
put :update, {:id => membership.to_param, :membership => valid_attributes}, valid_session
|
||||
assigns(:membership).should eq(membership)
|
||||
end
|
||||
|
||||
it "redirects to the membership" do
|
||||
membership = Membership.create! valid_attributes
|
||||
put :update, {:id => membership.to_param, :membership => valid_attributes}, valid_session
|
||||
response.should redirect_to(membership)
|
||||
end
|
||||
end
|
||||
|
||||
describe "with invalid params" do
|
||||
it "assigns the membership as @membership" do
|
||||
membership = Membership.create! valid_attributes
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Membership.any_instance.stub(:save).and_return(false)
|
||||
put :update, {:id => membership.to_param, :membership => { "fetprofile_id" => "invalid value" }}, valid_session
|
||||
assigns(:membership).should eq(membership)
|
||||
end
|
||||
|
||||
it "re-renders the 'edit' template" do
|
||||
membership = Membership.create! valid_attributes
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Membership.any_instance.stub(:save).and_return(false)
|
||||
put :update, {:id => membership.to_param, :membership => { "fetprofile_id" => "invalid value" }}, valid_session
|
||||
response.should render_template("edit")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE destroy" do
|
||||
it "destroys the requested membership" do
|
||||
membership = Membership.create! valid_attributes
|
||||
expect {
|
||||
delete :destroy, {:id => membership.to_param}, valid_session
|
||||
}.to change(Membership, :count).by(-1)
|
||||
end
|
||||
|
||||
it "redirects to the memberships list" do
|
||||
membership = Membership.create! valid_attributes
|
||||
delete :destroy, {:id => membership.to_param}, valid_session
|
||||
response.should redirect_to(memberships_url)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
13
spec/factories/fetprofiles.rb
Normal file
13
spec/factories/fetprofiles.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
# Read about factories at https://github.com/thoughtbot/factory_girl
|
||||
|
||||
FactoryGirl.define do
|
||||
factory :fetprofile do
|
||||
vorname "MyString"
|
||||
nachname "MyString"
|
||||
short "MyString"
|
||||
fetmailalias "MyString"
|
||||
desc "MyText"
|
||||
picture "MyString"
|
||||
active false
|
||||
end
|
||||
end
|
||||
10
spec/factories/fotos.rb
Normal file
10
spec/factories/fotos.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
# Read about factories at https://github.com/thoughtbot/factory_girl
|
||||
|
||||
FactoryGirl.define do
|
||||
factory :foto do
|
||||
title "MyString"
|
||||
desc "MyText"
|
||||
gallery_id 1
|
||||
datei "MyString"
|
||||
end
|
||||
end
|
||||
9
spec/factories/galleries.rb
Normal file
9
spec/factories/galleries.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
# Read about factories at https://github.com/thoughtbot/factory_girl
|
||||
|
||||
FactoryGirl.define do
|
||||
factory :gallery do
|
||||
name "MyString"
|
||||
desc "MyText"
|
||||
datum "2013-08-19"
|
||||
end
|
||||
end
|
||||
9
spec/factories/gremien.rb
Normal file
9
spec/factories/gremien.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
# Read about factories at https://github.com/thoughtbot/factory_girl
|
||||
|
||||
FactoryGirl.define do
|
||||
factory :gremium do
|
||||
name "MyString"
|
||||
desc "MyText"
|
||||
typ "MyString"
|
||||
end
|
||||
end
|
||||
11
spec/factories/memberships.rb
Normal file
11
spec/factories/memberships.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
# Read about factories at https://github.com/thoughtbot/factory_girl
|
||||
|
||||
FactoryGirl.define do
|
||||
factory :membership do
|
||||
fetprofile_id "MyString"
|
||||
gremium_id "MyString"
|
||||
start "2013-08-19"
|
||||
stop "2013-08-19"
|
||||
typ "MyString"
|
||||
end
|
||||
end
|
||||
15
spec/helpers/fetprofiles_helper_spec.rb
Normal file
15
spec/helpers/fetprofiles_helper_spec.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
require 'spec_helper'
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
# the FetprofilesHelper. For example:
|
||||
#
|
||||
# describe FetprofilesHelper do
|
||||
# describe "string concat" do
|
||||
# it "concats two strings with spaces" do
|
||||
# expect(helper.concat_strings("this","that")).to eq("this that")
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
describe FetprofilesHelper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
15
spec/helpers/fotos_helper_spec.rb
Normal file
15
spec/helpers/fotos_helper_spec.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
require 'spec_helper'
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
# the FotosHelper. For example:
|
||||
#
|
||||
# describe FotosHelper do
|
||||
# describe "string concat" do
|
||||
# it "concats two strings with spaces" do
|
||||
# expect(helper.concat_strings("this","that")).to eq("this that")
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
describe FotosHelper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
15
spec/helpers/galleries_helper_spec.rb
Normal file
15
spec/helpers/galleries_helper_spec.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
require 'spec_helper'
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
# the GalleriesHelper. For example:
|
||||
#
|
||||
# describe GalleriesHelper do
|
||||
# describe "string concat" do
|
||||
# it "concats two strings with spaces" do
|
||||
# expect(helper.concat_strings("this","that")).to eq("this that")
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
describe GalleriesHelper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
15
spec/helpers/gremien_helper_spec.rb
Normal file
15
spec/helpers/gremien_helper_spec.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
require 'spec_helper'
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
# the GremienHelper. For example:
|
||||
#
|
||||
# describe GremienHelper do
|
||||
# describe "string concat" do
|
||||
# it "concats two strings with spaces" do
|
||||
# expect(helper.concat_strings("this","that")).to eq("this that")
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
describe GremienHelper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
15
spec/helpers/memberships_helper_spec.rb
Normal file
15
spec/helpers/memberships_helper_spec.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
require 'spec_helper'
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
# the MembershipsHelper. For example:
|
||||
#
|
||||
# describe MembershipsHelper do
|
||||
# describe "string concat" do
|
||||
# it "concats two strings with spaces" do
|
||||
# expect(helper.concat_strings("this","that")).to eq("this that")
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
describe MembershipsHelper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
5
spec/models/fetprofile_spec.rb
Normal file
5
spec/models/fetprofile_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Fetprofile do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
5
spec/models/foto_spec.rb
Normal file
5
spec/models/foto_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Foto do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
5
spec/models/gallery_spec.rb
Normal file
5
spec/models/gallery_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Gallery do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
5
spec/models/gremium_spec.rb
Normal file
5
spec/models/gremium_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Gremium do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
5
spec/models/membership_spec.rb
Normal file
5
spec/models/membership_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Membership do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
11
spec/requests/fetprofiles_spec.rb
Normal file
11
spec/requests/fetprofiles_spec.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "Fetprofiles" do
|
||||
describe "GET /fetprofiles" 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 fetprofiles_path
|
||||
response.status.should be(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
11
spec/requests/fotos_spec.rb
Normal file
11
spec/requests/fotos_spec.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "Fotos" do
|
||||
describe "GET /fotos" 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 fotos_path
|
||||
response.status.should be(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
11
spec/requests/galleries_spec.rb
Normal file
11
spec/requests/galleries_spec.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "Galleries" do
|
||||
describe "GET /galleries" 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 galleries_path
|
||||
response.status.should be(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
11
spec/requests/gremien_spec.rb
Normal file
11
spec/requests/gremien_spec.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "Gremien" do
|
||||
describe "GET /gremien" 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 gremien_path
|
||||
response.status.should be(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
11
spec/requests/memberships_spec.rb
Normal file
11
spec/requests/memberships_spec.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "Memberships" do
|
||||
describe "GET /memberships" 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 memberships_path
|
||||
response.status.should be(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
35
spec/routing/fetprofiles_routing_spec.rb
Normal file
35
spec/routing/fetprofiles_routing_spec.rb
Normal file
@@ -0,0 +1,35 @@
|
||||
require "spec_helper"
|
||||
|
||||
describe FetprofilesController do
|
||||
describe "routing" do
|
||||
|
||||
it "routes to #index" do
|
||||
get("/fetprofiles").should route_to("fetprofiles#index")
|
||||
end
|
||||
|
||||
it "routes to #new" do
|
||||
get("/fetprofiles/new").should route_to("fetprofiles#new")
|
||||
end
|
||||
|
||||
it "routes to #show" do
|
||||
get("/fetprofiles/1").should route_to("fetprofiles#show", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #edit" do
|
||||
get("/fetprofiles/1/edit").should route_to("fetprofiles#edit", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #create" do
|
||||
post("/fetprofiles").should route_to("fetprofiles#create")
|
||||
end
|
||||
|
||||
it "routes to #update" do
|
||||
put("/fetprofiles/1").should route_to("fetprofiles#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #destroy" do
|
||||
delete("/fetprofiles/1").should route_to("fetprofiles#destroy", :id => "1")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
35
spec/routing/fotos_routing_spec.rb
Normal file
35
spec/routing/fotos_routing_spec.rb
Normal file
@@ -0,0 +1,35 @@
|
||||
require "spec_helper"
|
||||
|
||||
describe FotosController do
|
||||
describe "routing" do
|
||||
|
||||
it "routes to #index" do
|
||||
get("/fotos").should route_to("fotos#index")
|
||||
end
|
||||
|
||||
it "routes to #new" do
|
||||
get("/fotos/new").should route_to("fotos#new")
|
||||
end
|
||||
|
||||
it "routes to #show" do
|
||||
get("/fotos/1").should route_to("fotos#show", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #edit" do
|
||||
get("/fotos/1/edit").should route_to("fotos#edit", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #create" do
|
||||
post("/fotos").should route_to("fotos#create")
|
||||
end
|
||||
|
||||
it "routes to #update" do
|
||||
put("/fotos/1").should route_to("fotos#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #destroy" do
|
||||
delete("/fotos/1").should route_to("fotos#destroy", :id => "1")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
35
spec/routing/galleries_routing_spec.rb
Normal file
35
spec/routing/galleries_routing_spec.rb
Normal file
@@ -0,0 +1,35 @@
|
||||
require "spec_helper"
|
||||
|
||||
describe GalleriesController do
|
||||
describe "routing" do
|
||||
|
||||
it "routes to #index" do
|
||||
get("/galleries").should route_to("galleries#index")
|
||||
end
|
||||
|
||||
it "routes to #new" do
|
||||
get("/galleries/new").should route_to("galleries#new")
|
||||
end
|
||||
|
||||
it "routes to #show" do
|
||||
get("/galleries/1").should route_to("galleries#show", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #edit" do
|
||||
get("/galleries/1/edit").should route_to("galleries#edit", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #create" do
|
||||
post("/galleries").should route_to("galleries#create")
|
||||
end
|
||||
|
||||
it "routes to #update" do
|
||||
put("/galleries/1").should route_to("galleries#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #destroy" do
|
||||
delete("/galleries/1").should route_to("galleries#destroy", :id => "1")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
35
spec/routing/gremien_routing_spec.rb
Normal file
35
spec/routing/gremien_routing_spec.rb
Normal file
@@ -0,0 +1,35 @@
|
||||
require "spec_helper"
|
||||
|
||||
describe GremienController do
|
||||
describe "routing" do
|
||||
|
||||
it "routes to #index" do
|
||||
get("/gremien").should route_to("gremien#index")
|
||||
end
|
||||
|
||||
it "routes to #new" do
|
||||
get("/gremien/new").should route_to("gremien#new")
|
||||
end
|
||||
|
||||
it "routes to #show" do
|
||||
get("/gremien/1").should route_to("gremien#show", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #edit" do
|
||||
get("/gremien/1/edit").should route_to("gremien#edit", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #create" do
|
||||
post("/gremien").should route_to("gremien#create")
|
||||
end
|
||||
|
||||
it "routes to #update" do
|
||||
put("/gremien/1").should route_to("gremien#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #destroy" do
|
||||
delete("/gremien/1").should route_to("gremien#destroy", :id => "1")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
35
spec/routing/memberships_routing_spec.rb
Normal file
35
spec/routing/memberships_routing_spec.rb
Normal file
@@ -0,0 +1,35 @@
|
||||
require "spec_helper"
|
||||
|
||||
describe MembershipsController do
|
||||
describe "routing" do
|
||||
|
||||
it "routes to #index" do
|
||||
get("/memberships").should route_to("memberships#index")
|
||||
end
|
||||
|
||||
it "routes to #new" do
|
||||
get("/memberships/new").should route_to("memberships#new")
|
||||
end
|
||||
|
||||
it "routes to #show" do
|
||||
get("/memberships/1").should route_to("memberships#show", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #edit" do
|
||||
get("/memberships/1/edit").should route_to("memberships#edit", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #create" do
|
||||
post("/memberships").should route_to("memberships#create")
|
||||
end
|
||||
|
||||
it "routes to #update" do
|
||||
put("/memberships/1").should route_to("memberships#update", :id => "1")
|
||||
end
|
||||
|
||||
it "routes to #destroy" do
|
||||
delete("/memberships/1").should route_to("memberships#destroy", :id => "1")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
30
spec/views/fetprofiles/edit.html.erb_spec.rb
Normal file
30
spec/views/fetprofiles/edit.html.erb_spec.rb
Normal file
@@ -0,0 +1,30 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fetprofiles/edit" do
|
||||
before(:each) do
|
||||
@fetprofile = assign(:fetprofile, stub_model(Fetprofile,
|
||||
:vorname => "MyString",
|
||||
:nachname => "MyString",
|
||||
:short => "MyString",
|
||||
:fetmailalias => "MyString",
|
||||
:desc => "MyText",
|
||||
:picture => "MyString",
|
||||
:active => false
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit fetprofile form" do
|
||||
render
|
||||
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form[action=?][method=?]", fetprofile_path(@fetprofile), "post" do
|
||||
assert_select "input#fetprofile_vorname[name=?]", "fetprofile[vorname]"
|
||||
assert_select "input#fetprofile_nachname[name=?]", "fetprofile[nachname]"
|
||||
assert_select "input#fetprofile_short[name=?]", "fetprofile[short]"
|
||||
assert_select "input#fetprofile_fetmailalias[name=?]", "fetprofile[fetmailalias]"
|
||||
assert_select "textarea#fetprofile_desc[name=?]", "fetprofile[desc]"
|
||||
assert_select "input#fetprofile_picture[name=?]", "fetprofile[picture]"
|
||||
assert_select "input#fetprofile_active[name=?]", "fetprofile[active]"
|
||||
end
|
||||
end
|
||||
end
|
||||
38
spec/views/fetprofiles/index.html.erb_spec.rb
Normal file
38
spec/views/fetprofiles/index.html.erb_spec.rb
Normal file
@@ -0,0 +1,38 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fetprofiles/index" do
|
||||
before(:each) do
|
||||
assign(:fetprofiles, [
|
||||
stub_model(Fetprofile,
|
||||
:vorname => "Vorname",
|
||||
:nachname => "Nachname",
|
||||
:short => "Short",
|
||||
:fetmailalias => "Fetmailalias",
|
||||
:desc => "MyText",
|
||||
:picture => "Picture",
|
||||
:active => false
|
||||
),
|
||||
stub_model(Fetprofile,
|
||||
:vorname => "Vorname",
|
||||
:nachname => "Nachname",
|
||||
:short => "Short",
|
||||
:fetmailalias => "Fetmailalias",
|
||||
:desc => "MyText",
|
||||
:picture => "Picture",
|
||||
:active => false
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of fetprofiles" do
|
||||
render
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "tr>td", :text => "Vorname".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Nachname".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Short".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Fetmailalias".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "MyText".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Picture".to_s, :count => 2
|
||||
assert_select "tr>td", :text => false.to_s, :count => 2
|
||||
end
|
||||
end
|
||||
30
spec/views/fetprofiles/new.html.erb_spec.rb
Normal file
30
spec/views/fetprofiles/new.html.erb_spec.rb
Normal file
@@ -0,0 +1,30 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fetprofiles/new" do
|
||||
before(:each) do
|
||||
assign(:fetprofile, stub_model(Fetprofile,
|
||||
:vorname => "MyString",
|
||||
:nachname => "MyString",
|
||||
:short => "MyString",
|
||||
:fetmailalias => "MyString",
|
||||
:desc => "MyText",
|
||||
:picture => "MyString",
|
||||
:active => false
|
||||
).as_new_record)
|
||||
end
|
||||
|
||||
it "renders new fetprofile form" do
|
||||
render
|
||||
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form[action=?][method=?]", fetprofiles_path, "post" do
|
||||
assert_select "input#fetprofile_vorname[name=?]", "fetprofile[vorname]"
|
||||
assert_select "input#fetprofile_nachname[name=?]", "fetprofile[nachname]"
|
||||
assert_select "input#fetprofile_short[name=?]", "fetprofile[short]"
|
||||
assert_select "input#fetprofile_fetmailalias[name=?]", "fetprofile[fetmailalias]"
|
||||
assert_select "textarea#fetprofile_desc[name=?]", "fetprofile[desc]"
|
||||
assert_select "input#fetprofile_picture[name=?]", "fetprofile[picture]"
|
||||
assert_select "input#fetprofile_active[name=?]", "fetprofile[active]"
|
||||
end
|
||||
end
|
||||
end
|
||||
27
spec/views/fetprofiles/show.html.erb_spec.rb
Normal file
27
spec/views/fetprofiles/show.html.erb_spec.rb
Normal file
@@ -0,0 +1,27 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fetprofiles/show" do
|
||||
before(:each) do
|
||||
@fetprofile = assign(:fetprofile, stub_model(Fetprofile,
|
||||
:vorname => "Vorname",
|
||||
:nachname => "Nachname",
|
||||
:short => "Short",
|
||||
:fetmailalias => "Fetmailalias",
|
||||
:desc => "MyText",
|
||||
:picture => "Picture",
|
||||
:active => false
|
||||
))
|
||||
end
|
||||
|
||||
it "renders attributes in <p>" do
|
||||
render
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
rendered.should match(/Vorname/)
|
||||
rendered.should match(/Nachname/)
|
||||
rendered.should match(/Short/)
|
||||
rendered.should match(/Fetmailalias/)
|
||||
rendered.should match(/MyText/)
|
||||
rendered.should match(/Picture/)
|
||||
rendered.should match(/false/)
|
||||
end
|
||||
end
|
||||
24
spec/views/fotos/edit.html.erb_spec.rb
Normal file
24
spec/views/fotos/edit.html.erb_spec.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fotos/edit" do
|
||||
before(:each) do
|
||||
@foto = assign(:foto, stub_model(Foto,
|
||||
:title => "MyString",
|
||||
:desc => "MyText",
|
||||
:gallery_id => 1,
|
||||
:datei => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit foto form" do
|
||||
render
|
||||
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form[action=?][method=?]", foto_path(@foto), "post" do
|
||||
assert_select "input#foto_title[name=?]", "foto[title]"
|
||||
assert_select "textarea#foto_desc[name=?]", "foto[desc]"
|
||||
assert_select "input#foto_gallery_id[name=?]", "foto[gallery_id]"
|
||||
assert_select "input#foto_datei[name=?]", "foto[datei]"
|
||||
end
|
||||
end
|
||||
end
|
||||
29
spec/views/fotos/index.html.erb_spec.rb
Normal file
29
spec/views/fotos/index.html.erb_spec.rb
Normal file
@@ -0,0 +1,29 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fotos/index" do
|
||||
before(:each) do
|
||||
assign(:fotos, [
|
||||
stub_model(Foto,
|
||||
:title => "Title",
|
||||
:desc => "MyText",
|
||||
:gallery_id => 1,
|
||||
:datei => "Datei"
|
||||
),
|
||||
stub_model(Foto,
|
||||
:title => "Title",
|
||||
:desc => "MyText",
|
||||
:gallery_id => 1,
|
||||
:datei => "Datei"
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of fotos" do
|
||||
render
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "tr>td", :text => "Title".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "MyText".to_s, :count => 2
|
||||
assert_select "tr>td", :text => 1.to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Datei".to_s, :count => 2
|
||||
end
|
||||
end
|
||||
24
spec/views/fotos/new.html.erb_spec.rb
Normal file
24
spec/views/fotos/new.html.erb_spec.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fotos/new" do
|
||||
before(:each) do
|
||||
assign(:foto, stub_model(Foto,
|
||||
:title => "MyString",
|
||||
:desc => "MyText",
|
||||
:gallery_id => 1,
|
||||
:datei => "MyString"
|
||||
).as_new_record)
|
||||
end
|
||||
|
||||
it "renders new foto form" do
|
||||
render
|
||||
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form[action=?][method=?]", fotos_path, "post" do
|
||||
assert_select "input#foto_title[name=?]", "foto[title]"
|
||||
assert_select "textarea#foto_desc[name=?]", "foto[desc]"
|
||||
assert_select "input#foto_gallery_id[name=?]", "foto[gallery_id]"
|
||||
assert_select "input#foto_datei[name=?]", "foto[datei]"
|
||||
end
|
||||
end
|
||||
end
|
||||
21
spec/views/fotos/show.html.erb_spec.rb
Normal file
21
spec/views/fotos/show.html.erb_spec.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fotos/show" do
|
||||
before(:each) do
|
||||
@foto = assign(:foto, stub_model(Foto,
|
||||
:title => "Title",
|
||||
:desc => "MyText",
|
||||
:gallery_id => 1,
|
||||
:datei => "Datei"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders attributes in <p>" do
|
||||
render
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
rendered.should match(/Title/)
|
||||
rendered.should match(/MyText/)
|
||||
rendered.should match(/1/)
|
||||
rendered.should match(/Datei/)
|
||||
end
|
||||
end
|
||||
20
spec/views/galleries/edit.html.erb_spec.rb
Normal file
20
spec/views/galleries/edit.html.erb_spec.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "galleries/edit" do
|
||||
before(:each) do
|
||||
@gallery = assign(:gallery, stub_model(Gallery,
|
||||
:name => "MyString",
|
||||
:desc => "MyText"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit gallery form" do
|
||||
render
|
||||
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form[action=?][method=?]", gallery_path(@gallery), "post" do
|
||||
assert_select "input#gallery_name[name=?]", "gallery[name]"
|
||||
assert_select "textarea#gallery_desc[name=?]", "gallery[desc]"
|
||||
end
|
||||
end
|
||||
end
|
||||
23
spec/views/galleries/index.html.erb_spec.rb
Normal file
23
spec/views/galleries/index.html.erb_spec.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "galleries/index" do
|
||||
before(:each) do
|
||||
assign(:galleries, [
|
||||
stub_model(Gallery,
|
||||
:name => "Name",
|
||||
:desc => "MyText"
|
||||
),
|
||||
stub_model(Gallery,
|
||||
:name => "Name",
|
||||
:desc => "MyText"
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of galleries" do
|
||||
render
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "tr>td", :text => "Name".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "MyText".to_s, :count => 2
|
||||
end
|
||||
end
|
||||
20
spec/views/galleries/new.html.erb_spec.rb
Normal file
20
spec/views/galleries/new.html.erb_spec.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "galleries/new" do
|
||||
before(:each) do
|
||||
assign(:gallery, stub_model(Gallery,
|
||||
:name => "MyString",
|
||||
:desc => "MyText"
|
||||
).as_new_record)
|
||||
end
|
||||
|
||||
it "renders new gallery form" do
|
||||
render
|
||||
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form[action=?][method=?]", galleries_path, "post" do
|
||||
assert_select "input#gallery_name[name=?]", "gallery[name]"
|
||||
assert_select "textarea#gallery_desc[name=?]", "gallery[desc]"
|
||||
end
|
||||
end
|
||||
end
|
||||
17
spec/views/galleries/show.html.erb_spec.rb
Normal file
17
spec/views/galleries/show.html.erb_spec.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "galleries/show" do
|
||||
before(:each) do
|
||||
@gallery = assign(:gallery, stub_model(Gallery,
|
||||
:name => "Name",
|
||||
:desc => "MyText"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders attributes in <p>" do
|
||||
render
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
rendered.should match(/Name/)
|
||||
rendered.should match(/MyText/)
|
||||
end
|
||||
end
|
||||
22
spec/views/gremien/edit.html.erb_spec.rb
Normal file
22
spec/views/gremien/edit.html.erb_spec.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "gremien/edit" do
|
||||
before(:each) do
|
||||
@gremium = assign(:gremium, stub_model(Gremium,
|
||||
:name => "MyString",
|
||||
:desc => "MyText",
|
||||
:typ => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit gremium form" do
|
||||
render
|
||||
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form[action=?][method=?]", gremium_path(@gremium), "post" do
|
||||
assert_select "input#gremium_name[name=?]", "gremium[name]"
|
||||
assert_select "textarea#gremium_desc[name=?]", "gremium[desc]"
|
||||
assert_select "input#gremium_typ[name=?]", "gremium[typ]"
|
||||
end
|
||||
end
|
||||
end
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user