New Feature: Themen/Informationen

This commit is contained in:
HausdorffHimself
2013-08-05 18:31:04 +02:00
parent e3f7d7e472
commit ac4cb5d0fe
96 changed files with 2139 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
require 'spec_helper'
describe "themen/edit" do
before(:each) do
@thema = assign(:thema, stub_model(Thema,
:title => "MyString",
:text => "MyText"
))
end
it "renders the edit thema form" do
render
# Run the generator again with the --webrat flag if you want to use webrat matchers
assert_select "form[action=?][method=?]", thema_path(@thema), "post" do
assert_select "input#thema_title[name=?]", "thema[title]"
assert_select "textarea#thema_text[name=?]", "thema[text]"
end
end
end

View File

@@ -0,0 +1,23 @@
require 'spec_helper'
describe "themen/index" do
before(:each) do
assign(:themen, [
stub_model(Thema,
:title => "Title",
:text => "MyText"
),
stub_model(Thema,
:title => "Title",
:text => "MyText"
)
])
end
it "renders a list of themen" 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
end
end

View File

@@ -0,0 +1,20 @@
require 'spec_helper'
describe "themen/new" do
before(:each) do
assign(:thema, stub_model(Thema,
:title => "MyString",
:text => "MyText"
).as_new_record)
end
it "renders new thema form" do
render
# Run the generator again with the --webrat flag if you want to use webrat matchers
assert_select "form[action=?][method=?]", themen_path, "post" do
assert_select "input#thema_title[name=?]", "thema[title]"
assert_select "textarea#thema_text[name=?]", "thema[text]"
end
end
end

View File

@@ -0,0 +1,17 @@
require 'spec_helper'
describe "themen/show" do
before(:each) do
@thema = assign(:thema, stub_model(Thema,
:title => "Title",
:text => "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(/Title/)
rendered.should match(/MyText/)
end
end