Merge branch 'master' of https://github.com/thisisaname/fetsite
Conflicts: app/controllers/neuigkeiten_controller.rb config/routes.rb
This commit is contained in:
@@ -37,6 +37,7 @@ GEM
|
|||||||
activesupport (3.2.13)
|
activesupport (3.2.13)
|
||||||
i18n (= 0.6.1)
|
i18n (= 0.6.1)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
|
acts_as_votable (0.10.0)
|
||||||
annotate (2.6.1)
|
annotate (2.6.1)
|
||||||
activerecord (>= 2.3.0)
|
activerecord (>= 2.3.0)
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
@@ -225,6 +226,7 @@ GEM
|
|||||||
rspec-expectations (~> 2.14.0)
|
rspec-expectations (~> 2.14.0)
|
||||||
rspec-mocks (~> 2.14.0)
|
rspec-mocks (~> 2.14.0)
|
||||||
rubyntlm (0.1.1)
|
rubyntlm (0.1.1)
|
||||||
|
rubyzip (1.1.6)
|
||||||
sanitize (2.0.6)
|
sanitize (2.0.6)
|
||||||
nokogiri (>= 1.4.4)
|
nokogiri (>= 1.4.4)
|
||||||
sass (3.2.13)
|
sass (3.2.13)
|
||||||
@@ -271,6 +273,7 @@ PLATFORMS
|
|||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
RedCloth
|
RedCloth
|
||||||
|
acts_as_votable
|
||||||
annotate (>= 2.5.0)
|
annotate (>= 2.5.0)
|
||||||
awesome_nested_set
|
awesome_nested_set
|
||||||
bootstrap-addons-rails
|
bootstrap-addons-rails
|
||||||
@@ -304,6 +307,7 @@ DEPENDENCIES
|
|||||||
rmagick
|
rmagick
|
||||||
rolify
|
rolify
|
||||||
rspec-rails
|
rspec-rails
|
||||||
|
rubyzip
|
||||||
sanitize
|
sanitize
|
||||||
sass-rails (~> 3.2)
|
sass-rails (~> 3.2)
|
||||||
seed_dump (~> 0.5.3)
|
seed_dump (~> 0.5.3)
|
||||||
|
|||||||
3
app/assets/javascripts/fetmeetings.js.coffee
Normal file
3
app/assets/javascripts/fetmeetings.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/fetmeetingtops.js.coffee
Normal file
3
app/assets/javascripts/fetmeetingtops.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/fetmeetings.css.scss
Normal file
3
app/assets/stylesheets/fetmeetings.css.scss
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
// Place all the styles related to the Fetmeetings controller here.
|
||||||
|
// They will automatically be included in application.css.
|
||||||
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||||
3
app/assets/stylesheets/fetmeetingtops.css.scss
Normal file
3
app/assets/stylesheets/fetmeetingtops.css.scss
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
// Place all the styles related to the Fetmeetingtops controller here.
|
||||||
|
// They will automatically be included in application.css.
|
||||||
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||||
84
app/controllers/fetmeetings_controller.rb
Normal file
84
app/controllers/fetmeetings_controller.rb
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
class FetmeetingsController < ApplicationController
|
||||||
|
# GET /fetmeetings
|
||||||
|
# GET /fetmeetings.json
|
||||||
|
def index
|
||||||
|
@fetmeetings = Fetmeeting.all
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html # index.html.erb
|
||||||
|
format.json { render json: @fetmeetings }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /fetmeetings/1
|
||||||
|
# GET /fetmeetings/1.json
|
||||||
|
def show
|
||||||
|
@fetmeeting = Fetmeeting.find(params[:id])
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html # show.html.erb
|
||||||
|
format.json { render json: @fetmeeting }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /fetmeetings/new
|
||||||
|
# GET /fetmeetings/new.json
|
||||||
|
def new
|
||||||
|
@fetmeeting = Fetmeeting.new
|
||||||
|
@fetmeeting.calentry=Calentry.new(typ: 0, object: @fetmeetings)
|
||||||
|
respond_to do |format|
|
||||||
|
format.html # new.html.erb
|
||||||
|
format.json { render json: @fetmeeting }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /fetmeetings/1/edit
|
||||||
|
def edit
|
||||||
|
@fetmeeting = Fetmeeting.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
# POST /fetmeetings
|
||||||
|
# POST /fetmeetings.json
|
||||||
|
def create
|
||||||
|
@fetmeeting = Fetmeeting.new(params[:fetmeeting])
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
if @fetmeeting.save
|
||||||
|
format.html { redirect_to @fetmeeting, notice: 'Fetmeeting was successfully created.' }
|
||||||
|
format.json { render json: @fetmeeting, status: :created, location: @fetmeeting }
|
||||||
|
else
|
||||||
|
format.html { render action: "new" }
|
||||||
|
format.json { render json: @fetmeeting.errors, status: :unprocessable_entity }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# PUT /fetmeetings/1
|
||||||
|
# PUT /fetmeetings/1.json
|
||||||
|
def update
|
||||||
|
@fetmeeting = Fetmeeting.find(params[:id])
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
if @fetmeeting.update_attributes(params[:fetmeeting])
|
||||||
|
format.html { redirect_to @fetmeeting, notice: 'Fetmeeting was successfully updated.' }
|
||||||
|
format.json { head :no_content }
|
||||||
|
else
|
||||||
|
format.html { render action: "edit" }
|
||||||
|
format.json { render json: @fetmeeting.errors, status: :unprocessable_entity }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# DELETE /fetmeetings/1
|
||||||
|
# DELETE /fetmeetings/1.json
|
||||||
|
def destroy
|
||||||
|
@fetmeeting = Fetmeeting.find(params[:id])
|
||||||
|
@fetmeeting.destroy
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html { redirect_to fetmeetings_url }
|
||||||
|
format.json { head :no_content }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
83
app/controllers/fetmeetingtops_controller.rb
Normal file
83
app/controllers/fetmeetingtops_controller.rb
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
class FetmeetingtopsController < ApplicationController
|
||||||
|
# GET /fetmeetingtops
|
||||||
|
# GET /fetmeetingtops.json
|
||||||
|
def index
|
||||||
|
@fetmeetingtops = Fetmeetingtop.all
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html # index.html.erb
|
||||||
|
format.json { render json: @fetmeetingtops }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /fetmeetingtops/1
|
||||||
|
# GET /fetmeetingtops/1.json
|
||||||
|
def show
|
||||||
|
@fetmeetingtop = Fetmeetingtop.find(params[:id])
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html # show.html.erb
|
||||||
|
format.json { render json: @fetmeetingtop }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /fetmeetingtops/new
|
||||||
|
# GET /fetmeetingtops/new.json
|
||||||
|
def new
|
||||||
|
@fetmeetingtop = Fetmeetingtop.new
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html # new.html.erb
|
||||||
|
format.json { render json: @fetmeetingtop }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /fetmeetingtops/1/edit
|
||||||
|
def edit
|
||||||
|
@fetmeetingtop = Fetmeetingtop.find(params[:id])
|
||||||
|
end
|
||||||
|
|
||||||
|
# POST /fetmeetingtops
|
||||||
|
# POST /fetmeetingtops.json
|
||||||
|
def create
|
||||||
|
@fetmeetingtop = Fetmeetingtop.new(params[:fetmeetingtop])
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
if @fetmeetingtop.save
|
||||||
|
format.html { redirect_to @fetmeetingtop, notice: 'Fetmeetingtop was successfully created.' }
|
||||||
|
format.json { render json: @fetmeetingtop, status: :created, location: @fetmeetingtop }
|
||||||
|
else
|
||||||
|
format.html { render action: "new" }
|
||||||
|
format.json { render json: @fetmeetingtop.errors, status: :unprocessable_entity }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# PUT /fetmeetingtops/1
|
||||||
|
# PUT /fetmeetingtops/1.json
|
||||||
|
def update
|
||||||
|
@fetmeetingtop = Fetmeetingtop.find(params[:id])
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
if @fetmeetingtop.update_attributes(params[:fetmeetingtop])
|
||||||
|
format.html { redirect_to @fetmeetingtop, notice: 'Fetmeetingtop was successfully updated.' }
|
||||||
|
format.json { head :no_content }
|
||||||
|
else
|
||||||
|
format.html { render action: "edit" }
|
||||||
|
format.json { render json: @fetmeetingtop.errors, status: :unprocessable_entity }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# DELETE /fetmeetingtops/1
|
||||||
|
# DELETE /fetmeetingtops/1.json
|
||||||
|
def destroy
|
||||||
|
@fetmeetingtop = Fetmeetingtop.find(params[:id])
|
||||||
|
@fetmeetingtop.destroy
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html { redirect_to fetmeetingtops_url }
|
||||||
|
format.json { head :no_content }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
class NeuigkeitenController < ApplicationController
|
|
||||||
|
class NeuigkeitenController < ApplicationController
|
||||||
before_filter :load_toolbar_elements, :only=>[:show,:find_link]
|
before_filter :load_toolbar_elements, :only=>[:show,:find_link]
|
||||||
before_filter :load_toolbar_elements_edit, :only=>[:edit]
|
before_filter :load_toolbar_elements_edit, :only=>[:edit]
|
||||||
|
|
||||||
|
|||||||
2
app/helpers/fetmeetings_helper.rb
Normal file
2
app/helpers/fetmeetings_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
module FetmeetingsHelper
|
||||||
|
end
|
||||||
2
app/helpers/fetmeetingtops_helper.rb
Normal file
2
app/helpers/fetmeetingtops_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
module FetmeetingtopsHelper
|
||||||
|
end
|
||||||
11
app/models/fetmeeting.rb
Normal file
11
app/models/fetmeeting.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
class Fetmeeting < ActiveRecord::Base
|
||||||
|
attr_accessible :tnlist, :typ, :calentry_attributes
|
||||||
|
has_many :fetmeetingtops
|
||||||
|
validates :typ, presence: true
|
||||||
|
validates :calentry, presence: true
|
||||||
|
has_one :calentry , as: :object
|
||||||
|
accepts_nested_attributes_for :calentry
|
||||||
|
def public
|
||||||
|
true
|
||||||
|
end
|
||||||
|
end
|
||||||
7
app/models/fetmeetingtop.rb
Normal file
7
app/models/fetmeetingtop.rb
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
class Fetmeetingtop < ActiveRecord::Base
|
||||||
|
attr_accessible :discussion, :ersteller, :fetmeeting_id, :text, :title
|
||||||
|
belongs_to :fetmeeting
|
||||||
|
validates :fetmeeting, presence: true
|
||||||
|
validates :title, presence: true , length:{minimum: 4}
|
||||||
|
validates :ersteller, presence: true
|
||||||
|
end
|
||||||
14
app/views/fetmeetings/_form.html.erb
Normal file
14
app/views/fetmeetings/_form.html.erb
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<%= semantic_form_for @fetmeeting do |f| %>
|
||||||
|
<%= f.inputs do %>
|
||||||
|
<%= f.input :tnlist %>
|
||||||
|
<%= f.input :typ %>
|
||||||
|
<%= f.semantic_fields_for :calentry , @fetmeeting.calentry do |calentry| %>
|
||||||
|
<%= render 'calentries/nested_fields', :f => calentry %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%= f.actions do %>
|
||||||
|
<%= f.action :submit, :as => :input %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
6
app/views/fetmeetings/edit.html.erb
Normal file
6
app/views/fetmeetings/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<h1>Editing fetmeeting</h1>
|
||||||
|
|
||||||
|
<%= render 'form' %>
|
||||||
|
|
||||||
|
<%= link_to 'Show', @fetmeeting %> |
|
||||||
|
<%= link_to 'Back', fetmeetings_path %>
|
||||||
25
app/views/fetmeetings/index.html.erb
Normal file
25
app/views/fetmeetings/index.html.erb
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<h1>Listing fetmeetings</h1>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Tnlist</th>
|
||||||
|
<th>Typ</th>
|
||||||
|
<th></th>
|
||||||
|
<th></th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<% @fetmeetings.each do |fetmeeting| %>
|
||||||
|
<tr>
|
||||||
|
<td><%= fetmeeting.tnlist %></td>
|
||||||
|
<td><%= fetmeeting.typ %></td>
|
||||||
|
<td><%= link_to 'Show', fetmeeting %></td>
|
||||||
|
<td><%= link_to 'Edit', edit_fetmeeting_path(fetmeeting) %></td>
|
||||||
|
<td><%= link_to 'Destroy', fetmeeting, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<%= link_to 'New Fetmeeting', new_fetmeeting_path %>
|
||||||
5
app/views/fetmeetings/new.html.erb
Normal file
5
app/views/fetmeetings/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<h1>New fetmeeting</h1>
|
||||||
|
|
||||||
|
<%= render 'form' %>
|
||||||
|
|
||||||
|
<%= link_to 'Back', fetmeetings_path %>
|
||||||
20
app/views/fetmeetings/show.html.erb
Normal file
20
app/views/fetmeetings/show.html.erb
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<p id="notice"><%= notice %></p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<b>Tnlist:</b>
|
||||||
|
<%= @fetmeeting.tnlist %>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<b>Typ:</b>
|
||||||
|
<%= @fetmeeting.typ %>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<ul>
|
||||||
|
<% @fetmeeting.fetmeetingtops.each do |top|%>
|
||||||
|
<li><%= render top %></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</p>
|
||||||
|
<%= link_to 'Edit', edit_fetmeeting_path(@fetmeeting) %> |
|
||||||
|
<%= link_to 'Back', fetmeetings_path %>
|
||||||
1
app/views/fetmeetingtops/_fetmeetingtop.html.erb
Normal file
1
app/views/fetmeetingtops/_fetmeetingtop.html.erb
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%= fetmeetingtop.title %> (<i><%= fetmeetingtop.ersteller %></i>)
|
||||||
14
app/views/fetmeetingtops/_form.html.erb
Normal file
14
app/views/fetmeetingtops/_form.html.erb
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<%= semantic_form_for @fetmeetingtop do |f| %>
|
||||||
|
<%= f.inputs do %>
|
||||||
|
<%= f.input :title %>
|
||||||
|
<%= f.input :text %>
|
||||||
|
<%= f.input :discussion , as: :tinymce_text %>
|
||||||
|
<%= f.input :ersteller %>
|
||||||
|
<%= f.input :fetmeeting_id %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%= f.actions do %>
|
||||||
|
<%= f.action :submit, :as => :input %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<%= tinymce %>
|
||||||
6
app/views/fetmeetingtops/edit.html.erb
Normal file
6
app/views/fetmeetingtops/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<h1>Editing fetmeetingtop</h1>
|
||||||
|
|
||||||
|
<%= render 'form' %>
|
||||||
|
|
||||||
|
<%= link_to 'Show', @fetmeetingtop %> |
|
||||||
|
<%= link_to 'Back', fetmeetingtops_path %>
|
||||||
31
app/views/fetmeetingtops/index.html.erb
Normal file
31
app/views/fetmeetingtops/index.html.erb
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<h1>Listing fetmeetingtops</h1>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Title</th>
|
||||||
|
<th>Text</th>
|
||||||
|
<th>Discussion</th>
|
||||||
|
<th>Ersteller</th>
|
||||||
|
<th>Fetmeeting</th>
|
||||||
|
<th></th>
|
||||||
|
<th></th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<% @fetmeetingtops.each do |fetmeetingtop| %>
|
||||||
|
<tr>
|
||||||
|
<td><%= fetmeetingtop.title %></td>
|
||||||
|
<td><%= fetmeetingtop.text %></td>
|
||||||
|
<td><%= fetmeetingtop.discussion %></td>
|
||||||
|
<td><%= fetmeetingtop.ersteller %></td>
|
||||||
|
<td><%= fetmeetingtop.fetmeeting_id %></td>
|
||||||
|
<td><%= link_to 'Show', fetmeetingtop %></td>
|
||||||
|
<td><%= link_to 'Edit', edit_fetmeetingtop_path(fetmeetingtop) %></td>
|
||||||
|
<td><%= link_to 'Destroy', fetmeetingtop, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<%= link_to 'New Fetmeetingtop', new_fetmeetingtop_path %>
|
||||||
5
app/views/fetmeetingtops/new.html.erb
Normal file
5
app/views/fetmeetingtops/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<h1>New fetmeetingtop</h1>
|
||||||
|
|
||||||
|
<%= render 'form' %>
|
||||||
|
|
||||||
|
<%= link_to 'Back', fetmeetingtops_path %>
|
||||||
30
app/views/fetmeetingtops/show.html.erb
Normal file
30
app/views/fetmeetingtops/show.html.erb
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<p id="notice"><%= notice %></p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<b>Title:</b>
|
||||||
|
<%= @fetmeetingtop.title %>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<b>Text:</b>
|
||||||
|
<%= @fetmeetingtop.text %>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<b>Discussion:</b>
|
||||||
|
<%= @fetmeetingtop.discussion %>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<b>Ersteller:</b>
|
||||||
|
<%= @fetmeetingtop.ersteller %>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<b>Fetmeeting:</b>
|
||||||
|
<%= @fetmeetingtop.fetmeeting_id %>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<%= link_to 'Edit', edit_fetmeetingtop_path(@fetmeetingtop) %> |
|
||||||
|
<%= link_to 'Back', fetmeetingtops_path %>
|
||||||
@@ -1,4 +1,11 @@
|
|||||||
Fetsite::Application.routes.draw do
|
|
||||||
|
Fetsite::Application.routes.draw do
|
||||||
|
resources :fetmeetingtops
|
||||||
|
|
||||||
|
|
||||||
|
resources :fetmeetings
|
||||||
|
|
||||||
|
|
||||||
themes_for_rails
|
themes_for_rails
|
||||||
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }
|
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }
|
||||||
resources :home, :only=>[:index] do
|
resources :home, :only=>[:index] do
|
||||||
|
|||||||
10
db/migrate/20140507125633_create_fetmeetings.rb
Normal file
10
db/migrate/20140507125633_create_fetmeetings.rb
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
class CreateFetmeetings < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :fetmeetings do |t|
|
||||||
|
t.text :tnlist
|
||||||
|
t.integer :typ
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
13
db/migrate/20140507130354_create_fetmeetingtops.rb
Normal file
13
db/migrate/20140507130354_create_fetmeetingtops.rb
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
class CreateFetmeetingtops < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :fetmeetingtops do |t|
|
||||||
|
t.string :title
|
||||||
|
t.text :text
|
||||||
|
t.text :discussion
|
||||||
|
t.string :ersteller
|
||||||
|
t.integer :fetmeeting_id
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
160
spec/controllers/fetmeetings_controller_spec.rb
Normal file
160
spec/controllers/fetmeetings_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 FetmeetingsController do
|
||||||
|
|
||||||
|
# This should return the minimal set of attributes required to create a valid
|
||||||
|
# Fetmeeting. As you add validations to Fetmeeting, be sure to
|
||||||
|
# adjust the attributes here as well.
|
||||||
|
let(:valid_attributes) { { "tnlist" => "MyText" } }
|
||||||
|
|
||||||
|
# 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
|
||||||
|
# FetmeetingsController. Be sure to keep this updated too.
|
||||||
|
let(:valid_session) { {} }
|
||||||
|
|
||||||
|
describe "GET index" do
|
||||||
|
it "assigns all fetmeetings as @fetmeetings" do
|
||||||
|
fetmeeting = Fetmeeting.create! valid_attributes
|
||||||
|
get :index, {}, valid_session
|
||||||
|
assigns(:fetmeetings).should eq([fetmeeting])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "GET show" do
|
||||||
|
it "assigns the requested fetmeeting as @fetmeeting" do
|
||||||
|
fetmeeting = Fetmeeting.create! valid_attributes
|
||||||
|
get :show, {:id => fetmeeting.to_param}, valid_session
|
||||||
|
assigns(:fetmeeting).should eq(fetmeeting)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "GET new" do
|
||||||
|
it "assigns a new fetmeeting as @fetmeeting" do
|
||||||
|
get :new, {}, valid_session
|
||||||
|
assigns(:fetmeeting).should be_a_new(Fetmeeting)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "GET edit" do
|
||||||
|
it "assigns the requested fetmeeting as @fetmeeting" do
|
||||||
|
fetmeeting = Fetmeeting.create! valid_attributes
|
||||||
|
get :edit, {:id => fetmeeting.to_param}, valid_session
|
||||||
|
assigns(:fetmeeting).should eq(fetmeeting)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "POST create" do
|
||||||
|
describe "with valid params" do
|
||||||
|
it "creates a new Fetmeeting" do
|
||||||
|
expect {
|
||||||
|
post :create, {:fetmeeting => valid_attributes}, valid_session
|
||||||
|
}.to change(Fetmeeting, :count).by(1)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "assigns a newly created fetmeeting as @fetmeeting" do
|
||||||
|
post :create, {:fetmeeting => valid_attributes}, valid_session
|
||||||
|
assigns(:fetmeeting).should be_a(Fetmeeting)
|
||||||
|
assigns(:fetmeeting).should be_persisted
|
||||||
|
end
|
||||||
|
|
||||||
|
it "redirects to the created fetmeeting" do
|
||||||
|
post :create, {:fetmeeting => valid_attributes}, valid_session
|
||||||
|
response.should redirect_to(Fetmeeting.last)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "with invalid params" do
|
||||||
|
it "assigns a newly created but unsaved fetmeeting as @fetmeeting" do
|
||||||
|
# Trigger the behavior that occurs when invalid params are submitted
|
||||||
|
Fetmeeting.any_instance.stub(:save).and_return(false)
|
||||||
|
post :create, {:fetmeeting => { "tnlist" => "invalid value" }}, valid_session
|
||||||
|
assigns(:fetmeeting).should be_a_new(Fetmeeting)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "re-renders the 'new' template" do
|
||||||
|
# Trigger the behavior that occurs when invalid params are submitted
|
||||||
|
Fetmeeting.any_instance.stub(:save).and_return(false)
|
||||||
|
post :create, {:fetmeeting => { "tnlist" => "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 fetmeeting" do
|
||||||
|
fetmeeting = Fetmeeting.create! valid_attributes
|
||||||
|
# Assuming there are no other fetmeetings in the database, this
|
||||||
|
# specifies that the Fetmeeting created on the previous line
|
||||||
|
# receives the :update_attributes message with whatever params are
|
||||||
|
# submitted in the request.
|
||||||
|
Fetmeeting.any_instance.should_receive(:update_attributes).with({ "tnlist" => "MyText" })
|
||||||
|
put :update, {:id => fetmeeting.to_param, :fetmeeting => { "tnlist" => "MyText" }}, valid_session
|
||||||
|
end
|
||||||
|
|
||||||
|
it "assigns the requested fetmeeting as @fetmeeting" do
|
||||||
|
fetmeeting = Fetmeeting.create! valid_attributes
|
||||||
|
put :update, {:id => fetmeeting.to_param, :fetmeeting => valid_attributes}, valid_session
|
||||||
|
assigns(:fetmeeting).should eq(fetmeeting)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "redirects to the fetmeeting" do
|
||||||
|
fetmeeting = Fetmeeting.create! valid_attributes
|
||||||
|
put :update, {:id => fetmeeting.to_param, :fetmeeting => valid_attributes}, valid_session
|
||||||
|
response.should redirect_to(fetmeeting)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "with invalid params" do
|
||||||
|
it "assigns the fetmeeting as @fetmeeting" do
|
||||||
|
fetmeeting = Fetmeeting.create! valid_attributes
|
||||||
|
# Trigger the behavior that occurs when invalid params are submitted
|
||||||
|
Fetmeeting.any_instance.stub(:save).and_return(false)
|
||||||
|
put :update, {:id => fetmeeting.to_param, :fetmeeting => { "tnlist" => "invalid value" }}, valid_session
|
||||||
|
assigns(:fetmeeting).should eq(fetmeeting)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "re-renders the 'edit' template" do
|
||||||
|
fetmeeting = Fetmeeting.create! valid_attributes
|
||||||
|
# Trigger the behavior that occurs when invalid params are submitted
|
||||||
|
Fetmeeting.any_instance.stub(:save).and_return(false)
|
||||||
|
put :update, {:id => fetmeeting.to_param, :fetmeeting => { "tnlist" => "invalid value" }}, valid_session
|
||||||
|
response.should render_template("edit")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "DELETE destroy" do
|
||||||
|
it "destroys the requested fetmeeting" do
|
||||||
|
fetmeeting = Fetmeeting.create! valid_attributes
|
||||||
|
expect {
|
||||||
|
delete :destroy, {:id => fetmeeting.to_param}, valid_session
|
||||||
|
}.to change(Fetmeeting, :count).by(-1)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "redirects to the fetmeetings list" do
|
||||||
|
fetmeeting = Fetmeeting.create! valid_attributes
|
||||||
|
delete :destroy, {:id => fetmeeting.to_param}, valid_session
|
||||||
|
response.should redirect_to(fetmeetings_url)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
160
spec/controllers/fetmeetingtops_controller_spec.rb
Normal file
160
spec/controllers/fetmeetingtops_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 FetmeetingtopsController do
|
||||||
|
|
||||||
|
# This should return the minimal set of attributes required to create a valid
|
||||||
|
# Fetmeetingtop. As you add validations to Fetmeetingtop, 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
|
||||||
|
# FetmeetingtopsController. Be sure to keep this updated too.
|
||||||
|
let(:valid_session) { {} }
|
||||||
|
|
||||||
|
describe "GET index" do
|
||||||
|
it "assigns all fetmeetingtops as @fetmeetingtops" do
|
||||||
|
fetmeetingtop = Fetmeetingtop.create! valid_attributes
|
||||||
|
get :index, {}, valid_session
|
||||||
|
assigns(:fetmeetingtops).should eq([fetmeetingtop])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "GET show" do
|
||||||
|
it "assigns the requested fetmeetingtop as @fetmeetingtop" do
|
||||||
|
fetmeetingtop = Fetmeetingtop.create! valid_attributes
|
||||||
|
get :show, {:id => fetmeetingtop.to_param}, valid_session
|
||||||
|
assigns(:fetmeetingtop).should eq(fetmeetingtop)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "GET new" do
|
||||||
|
it "assigns a new fetmeetingtop as @fetmeetingtop" do
|
||||||
|
get :new, {}, valid_session
|
||||||
|
assigns(:fetmeetingtop).should be_a_new(Fetmeetingtop)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "GET edit" do
|
||||||
|
it "assigns the requested fetmeetingtop as @fetmeetingtop" do
|
||||||
|
fetmeetingtop = Fetmeetingtop.create! valid_attributes
|
||||||
|
get :edit, {:id => fetmeetingtop.to_param}, valid_session
|
||||||
|
assigns(:fetmeetingtop).should eq(fetmeetingtop)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "POST create" do
|
||||||
|
describe "with valid params" do
|
||||||
|
it "creates a new Fetmeetingtop" do
|
||||||
|
expect {
|
||||||
|
post :create, {:fetmeetingtop => valid_attributes}, valid_session
|
||||||
|
}.to change(Fetmeetingtop, :count).by(1)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "assigns a newly created fetmeetingtop as @fetmeetingtop" do
|
||||||
|
post :create, {:fetmeetingtop => valid_attributes}, valid_session
|
||||||
|
assigns(:fetmeetingtop).should be_a(Fetmeetingtop)
|
||||||
|
assigns(:fetmeetingtop).should be_persisted
|
||||||
|
end
|
||||||
|
|
||||||
|
it "redirects to the created fetmeetingtop" do
|
||||||
|
post :create, {:fetmeetingtop => valid_attributes}, valid_session
|
||||||
|
response.should redirect_to(Fetmeetingtop.last)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "with invalid params" do
|
||||||
|
it "assigns a newly created but unsaved fetmeetingtop as @fetmeetingtop" do
|
||||||
|
# Trigger the behavior that occurs when invalid params are submitted
|
||||||
|
Fetmeetingtop.any_instance.stub(:save).and_return(false)
|
||||||
|
post :create, {:fetmeetingtop => { "title" => "invalid value" }}, valid_session
|
||||||
|
assigns(:fetmeetingtop).should be_a_new(Fetmeetingtop)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "re-renders the 'new' template" do
|
||||||
|
# Trigger the behavior that occurs when invalid params are submitted
|
||||||
|
Fetmeetingtop.any_instance.stub(:save).and_return(false)
|
||||||
|
post :create, {:fetmeetingtop => { "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 fetmeetingtop" do
|
||||||
|
fetmeetingtop = Fetmeetingtop.create! valid_attributes
|
||||||
|
# Assuming there are no other fetmeetingtops in the database, this
|
||||||
|
# specifies that the Fetmeetingtop created on the previous line
|
||||||
|
# receives the :update_attributes message with whatever params are
|
||||||
|
# submitted in the request.
|
||||||
|
Fetmeetingtop.any_instance.should_receive(:update_attributes).with({ "title" => "MyString" })
|
||||||
|
put :update, {:id => fetmeetingtop.to_param, :fetmeetingtop => { "title" => "MyString" }}, valid_session
|
||||||
|
end
|
||||||
|
|
||||||
|
it "assigns the requested fetmeetingtop as @fetmeetingtop" do
|
||||||
|
fetmeetingtop = Fetmeetingtop.create! valid_attributes
|
||||||
|
put :update, {:id => fetmeetingtop.to_param, :fetmeetingtop => valid_attributes}, valid_session
|
||||||
|
assigns(:fetmeetingtop).should eq(fetmeetingtop)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "redirects to the fetmeetingtop" do
|
||||||
|
fetmeetingtop = Fetmeetingtop.create! valid_attributes
|
||||||
|
put :update, {:id => fetmeetingtop.to_param, :fetmeetingtop => valid_attributes}, valid_session
|
||||||
|
response.should redirect_to(fetmeetingtop)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "with invalid params" do
|
||||||
|
it "assigns the fetmeetingtop as @fetmeetingtop" do
|
||||||
|
fetmeetingtop = Fetmeetingtop.create! valid_attributes
|
||||||
|
# Trigger the behavior that occurs when invalid params are submitted
|
||||||
|
Fetmeetingtop.any_instance.stub(:save).and_return(false)
|
||||||
|
put :update, {:id => fetmeetingtop.to_param, :fetmeetingtop => { "title" => "invalid value" }}, valid_session
|
||||||
|
assigns(:fetmeetingtop).should eq(fetmeetingtop)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "re-renders the 'edit' template" do
|
||||||
|
fetmeetingtop = Fetmeetingtop.create! valid_attributes
|
||||||
|
# Trigger the behavior that occurs when invalid params are submitted
|
||||||
|
Fetmeetingtop.any_instance.stub(:save).and_return(false)
|
||||||
|
put :update, {:id => fetmeetingtop.to_param, :fetmeetingtop => { "title" => "invalid value" }}, valid_session
|
||||||
|
response.should render_template("edit")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "DELETE destroy" do
|
||||||
|
it "destroys the requested fetmeetingtop" do
|
||||||
|
fetmeetingtop = Fetmeetingtop.create! valid_attributes
|
||||||
|
expect {
|
||||||
|
delete :destroy, {:id => fetmeetingtop.to_param}, valid_session
|
||||||
|
}.to change(Fetmeetingtop, :count).by(-1)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "redirects to the fetmeetingtops list" do
|
||||||
|
fetmeetingtop = Fetmeetingtop.create! valid_attributes
|
||||||
|
delete :destroy, {:id => fetmeetingtop.to_param}, valid_session
|
||||||
|
response.should redirect_to(fetmeetingtops_url)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
8
spec/factories/fetmeetings.rb
Normal file
8
spec/factories/fetmeetings.rb
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Read about factories at https://github.com/thoughtbot/factory_girl
|
||||||
|
|
||||||
|
FactoryGirl.define do
|
||||||
|
factory :fetmeeting do
|
||||||
|
tnlist "MyText"
|
||||||
|
typ 1
|
||||||
|
end
|
||||||
|
end
|
||||||
11
spec/factories/fetmeetingtops.rb
Normal file
11
spec/factories/fetmeetingtops.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Read about factories at https://github.com/thoughtbot/factory_girl
|
||||||
|
|
||||||
|
FactoryGirl.define do
|
||||||
|
factory :fetmeetingtop do
|
||||||
|
title "MyString"
|
||||||
|
text "MyText"
|
||||||
|
discussion "MyText"
|
||||||
|
ersteller "MyString"
|
||||||
|
fetmeeting_id 1
|
||||||
|
end
|
||||||
|
end
|
||||||
15
spec/helpers/fetmeetings_helper_spec.rb
Normal file
15
spec/helpers/fetmeetings_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 FetmeetingsHelper. For example:
|
||||||
|
#
|
||||||
|
# describe FetmeetingsHelper 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 FetmeetingsHelper do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
||||||
15
spec/helpers/fetmeetingtops_helper_spec.rb
Normal file
15
spec/helpers/fetmeetingtops_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 FetmeetingtopsHelper. For example:
|
||||||
|
#
|
||||||
|
# describe FetmeetingtopsHelper 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 FetmeetingtopsHelper do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
||||||
5
spec/models/fetmeeting_spec.rb
Normal file
5
spec/models/fetmeeting_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe Fetmeeting do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
||||||
5
spec/models/fetmeetingtop_spec.rb
Normal file
5
spec/models/fetmeetingtop_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe Fetmeetingtop do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
||||||
11
spec/requests/fetmeetings_spec.rb
Normal file
11
spec/requests/fetmeetings_spec.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe "Fetmeetings" do
|
||||||
|
describe "GET /fetmeetings" 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 fetmeetings_path
|
||||||
|
response.status.should be(200)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
11
spec/requests/fetmeetingtops_spec.rb
Normal file
11
spec/requests/fetmeetingtops_spec.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe "Fetmeetingtops" do
|
||||||
|
describe "GET /fetmeetingtops" 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 fetmeetingtops_path
|
||||||
|
response.status.should be(200)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
35
spec/routing/fetmeetings_routing_spec.rb
Normal file
35
spec/routing/fetmeetings_routing_spec.rb
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
require "spec_helper"
|
||||||
|
|
||||||
|
describe FetmeetingsController do
|
||||||
|
describe "routing" do
|
||||||
|
|
||||||
|
it "routes to #index" do
|
||||||
|
get("/fetmeetings").should route_to("fetmeetings#index")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "routes to #new" do
|
||||||
|
get("/fetmeetings/new").should route_to("fetmeetings#new")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "routes to #show" do
|
||||||
|
get("/fetmeetings/1").should route_to("fetmeetings#show", :id => "1")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "routes to #edit" do
|
||||||
|
get("/fetmeetings/1/edit").should route_to("fetmeetings#edit", :id => "1")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "routes to #create" do
|
||||||
|
post("/fetmeetings").should route_to("fetmeetings#create")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "routes to #update" do
|
||||||
|
put("/fetmeetings/1").should route_to("fetmeetings#update", :id => "1")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "routes to #destroy" do
|
||||||
|
delete("/fetmeetings/1").should route_to("fetmeetings#destroy", :id => "1")
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
35
spec/routing/fetmeetingtops_routing_spec.rb
Normal file
35
spec/routing/fetmeetingtops_routing_spec.rb
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
require "spec_helper"
|
||||||
|
|
||||||
|
describe FetmeetingtopsController do
|
||||||
|
describe "routing" do
|
||||||
|
|
||||||
|
it "routes to #index" do
|
||||||
|
get("/fetmeetingtops").should route_to("fetmeetingtops#index")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "routes to #new" do
|
||||||
|
get("/fetmeetingtops/new").should route_to("fetmeetingtops#new")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "routes to #show" do
|
||||||
|
get("/fetmeetingtops/1").should route_to("fetmeetingtops#show", :id => "1")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "routes to #edit" do
|
||||||
|
get("/fetmeetingtops/1/edit").should route_to("fetmeetingtops#edit", :id => "1")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "routes to #create" do
|
||||||
|
post("/fetmeetingtops").should route_to("fetmeetingtops#create")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "routes to #update" do
|
||||||
|
put("/fetmeetingtops/1").should route_to("fetmeetingtops#update", :id => "1")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "routes to #destroy" do
|
||||||
|
delete("/fetmeetingtops/1").should route_to("fetmeetingtops#destroy", :id => "1")
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
20
spec/views/fetmeetings/edit.html.erb_spec.rb
Normal file
20
spec/views/fetmeetings/edit.html.erb_spec.rb
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe "fetmeetings/edit" do
|
||||||
|
before(:each) do
|
||||||
|
@fetmeeting = assign(:fetmeeting, stub_model(Fetmeeting,
|
||||||
|
:tnlist => "MyText",
|
||||||
|
:typ => 1
|
||||||
|
))
|
||||||
|
end
|
||||||
|
|
||||||
|
it "renders the edit fetmeeting form" do
|
||||||
|
render
|
||||||
|
|
||||||
|
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||||
|
assert_select "form[action=?][method=?]", fetmeeting_path(@fetmeeting), "post" do
|
||||||
|
assert_select "textarea#fetmeeting_tnlist[name=?]", "fetmeeting[tnlist]"
|
||||||
|
assert_select "input#fetmeeting_typ[name=?]", "fetmeeting[typ]"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
23
spec/views/fetmeetings/index.html.erb_spec.rb
Normal file
23
spec/views/fetmeetings/index.html.erb_spec.rb
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe "fetmeetings/index" do
|
||||||
|
before(:each) do
|
||||||
|
assign(:fetmeetings, [
|
||||||
|
stub_model(Fetmeeting,
|
||||||
|
:tnlist => "MyText",
|
||||||
|
:typ => 1
|
||||||
|
),
|
||||||
|
stub_model(Fetmeeting,
|
||||||
|
:tnlist => "MyText",
|
||||||
|
:typ => 1
|
||||||
|
)
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
it "renders a list of fetmeetings" do
|
||||||
|
render
|
||||||
|
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||||
|
assert_select "tr>td", :text => "MyText".to_s, :count => 2
|
||||||
|
assert_select "tr>td", :text => 1.to_s, :count => 2
|
||||||
|
end
|
||||||
|
end
|
||||||
20
spec/views/fetmeetings/new.html.erb_spec.rb
Normal file
20
spec/views/fetmeetings/new.html.erb_spec.rb
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe "fetmeetings/new" do
|
||||||
|
before(:each) do
|
||||||
|
assign(:fetmeeting, stub_model(Fetmeeting,
|
||||||
|
:tnlist => "MyText",
|
||||||
|
:typ => 1
|
||||||
|
).as_new_record)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "renders new fetmeeting form" do
|
||||||
|
render
|
||||||
|
|
||||||
|
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||||
|
assert_select "form[action=?][method=?]", fetmeetings_path, "post" do
|
||||||
|
assert_select "textarea#fetmeeting_tnlist[name=?]", "fetmeeting[tnlist]"
|
||||||
|
assert_select "input#fetmeeting_typ[name=?]", "fetmeeting[typ]"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
17
spec/views/fetmeetings/show.html.erb_spec.rb
Normal file
17
spec/views/fetmeetings/show.html.erb_spec.rb
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe "fetmeetings/show" do
|
||||||
|
before(:each) do
|
||||||
|
@fetmeeting = assign(:fetmeeting, stub_model(Fetmeeting,
|
||||||
|
:tnlist => "MyText",
|
||||||
|
:typ => 1
|
||||||
|
))
|
||||||
|
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(/MyText/)
|
||||||
|
rendered.should match(/1/)
|
||||||
|
end
|
||||||
|
end
|
||||||
26
spec/views/fetmeetingtops/edit.html.erb_spec.rb
Normal file
26
spec/views/fetmeetingtops/edit.html.erb_spec.rb
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe "fetmeetingtops/edit" do
|
||||||
|
before(:each) do
|
||||||
|
@fetmeetingtop = assign(:fetmeetingtop, stub_model(Fetmeetingtop,
|
||||||
|
:title => "MyString",
|
||||||
|
:text => "MyText",
|
||||||
|
:discussion => "MyText",
|
||||||
|
:ersteller => "MyString",
|
||||||
|
:fetmeeting_id => 1
|
||||||
|
))
|
||||||
|
end
|
||||||
|
|
||||||
|
it "renders the edit fetmeetingtop form" do
|
||||||
|
render
|
||||||
|
|
||||||
|
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||||
|
assert_select "form[action=?][method=?]", fetmeetingtop_path(@fetmeetingtop), "post" do
|
||||||
|
assert_select "input#fetmeetingtop_title[name=?]", "fetmeetingtop[title]"
|
||||||
|
assert_select "textarea#fetmeetingtop_text[name=?]", "fetmeetingtop[text]"
|
||||||
|
assert_select "textarea#fetmeetingtop_discussion[name=?]", "fetmeetingtop[discussion]"
|
||||||
|
assert_select "input#fetmeetingtop_ersteller[name=?]", "fetmeetingtop[ersteller]"
|
||||||
|
assert_select "input#fetmeetingtop_fetmeeting_id[name=?]", "fetmeetingtop[fetmeeting_id]"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
32
spec/views/fetmeetingtops/index.html.erb_spec.rb
Normal file
32
spec/views/fetmeetingtops/index.html.erb_spec.rb
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe "fetmeetingtops/index" do
|
||||||
|
before(:each) do
|
||||||
|
assign(:fetmeetingtops, [
|
||||||
|
stub_model(Fetmeetingtop,
|
||||||
|
:title => "Title",
|
||||||
|
:text => "MyText",
|
||||||
|
:discussion => "MyText",
|
||||||
|
:ersteller => "Ersteller",
|
||||||
|
:fetmeeting_id => 1
|
||||||
|
),
|
||||||
|
stub_model(Fetmeetingtop,
|
||||||
|
:title => "Title",
|
||||||
|
:text => "MyText",
|
||||||
|
:discussion => "MyText",
|
||||||
|
:ersteller => "Ersteller",
|
||||||
|
:fetmeeting_id => 1
|
||||||
|
)
|
||||||
|
])
|
||||||
|
end
|
||||||
|
|
||||||
|
it "renders a list of fetmeetingtops" 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 => "MyText".to_s, :count => 2
|
||||||
|
assert_select "tr>td", :text => "Ersteller".to_s, :count => 2
|
||||||
|
assert_select "tr>td", :text => 1.to_s, :count => 2
|
||||||
|
end
|
||||||
|
end
|
||||||
26
spec/views/fetmeetingtops/new.html.erb_spec.rb
Normal file
26
spec/views/fetmeetingtops/new.html.erb_spec.rb
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe "fetmeetingtops/new" do
|
||||||
|
before(:each) do
|
||||||
|
assign(:fetmeetingtop, stub_model(Fetmeetingtop,
|
||||||
|
:title => "MyString",
|
||||||
|
:text => "MyText",
|
||||||
|
:discussion => "MyText",
|
||||||
|
:ersteller => "MyString",
|
||||||
|
:fetmeeting_id => 1
|
||||||
|
).as_new_record)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "renders new fetmeetingtop form" do
|
||||||
|
render
|
||||||
|
|
||||||
|
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||||
|
assert_select "form[action=?][method=?]", fetmeetingtops_path, "post" do
|
||||||
|
assert_select "input#fetmeetingtop_title[name=?]", "fetmeetingtop[title]"
|
||||||
|
assert_select "textarea#fetmeetingtop_text[name=?]", "fetmeetingtop[text]"
|
||||||
|
assert_select "textarea#fetmeetingtop_discussion[name=?]", "fetmeetingtop[discussion]"
|
||||||
|
assert_select "input#fetmeetingtop_ersteller[name=?]", "fetmeetingtop[ersteller]"
|
||||||
|
assert_select "input#fetmeetingtop_fetmeeting_id[name=?]", "fetmeetingtop[fetmeeting_id]"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
23
spec/views/fetmeetingtops/show.html.erb_spec.rb
Normal file
23
spec/views/fetmeetingtops/show.html.erb_spec.rb
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe "fetmeetingtops/show" do
|
||||||
|
before(:each) do
|
||||||
|
@fetmeetingtop = assign(:fetmeetingtop, stub_model(Fetmeetingtop,
|
||||||
|
:title => "Title",
|
||||||
|
:text => "MyText",
|
||||||
|
:discussion => "MyText",
|
||||||
|
:ersteller => "Ersteller",
|
||||||
|
:fetmeeting_id => 1
|
||||||
|
))
|
||||||
|
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(/MyText/)
|
||||||
|
rendered.should match(/Ersteller/)
|
||||||
|
rendered.should match(/1/)
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user