Conflicts:
	app/views/layouts/menu.html.erb
	config/routes.rb
This commit is contained in:
HausdorffHimself
2013-08-13 19:05:26 +02:00
94 changed files with 2318 additions and 327 deletions

View File

@@ -0,0 +1,20 @@
require 'spec_helper'
describe "calendars/edit" do
before(:each) do
@calendar = assign(:calendar, stub_model(Calendar,
:name => "MyString",
:public => false
))
end
it "renders the edit calendar form" do
render
# Run the generator again with the --webrat flag if you want to use webrat matchers
assert_select "form[action=?][method=?]", calendar_path(@calendar), "post" do
assert_select "input#calendar_name[name=?]", "calendar[name]"
assert_select "input#calendar_public[name=?]", "calendar[public]"
end
end
end

View File

@@ -0,0 +1,23 @@
require 'spec_helper'
describe "calendars/index" do
before(:each) do
assign(:calendars, [
stub_model(Calendar,
:name => "Name",
:public => false
),
stub_model(Calendar,
:name => "Name",
:public => false
)
])
end
it "renders a list of calendars" 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 => false.to_s, :count => 2
end
end

View File

@@ -0,0 +1,20 @@
require 'spec_helper'
describe "calendars/new" do
before(:each) do
assign(:calendar, stub_model(Calendar,
:name => "MyString",
:public => false
).as_new_record)
end
it "renders new calendar form" do
render
# Run the generator again with the --webrat flag if you want to use webrat matchers
assert_select "form[action=?][method=?]", calendars_path, "post" do
assert_select "input#calendar_name[name=?]", "calendar[name]"
assert_select "input#calendar_public[name=?]", "calendar[public]"
end
end
end

View File

@@ -0,0 +1,17 @@
require 'spec_helper'
describe "calendars/show" do
before(:each) do
@calendar = assign(:calendar, stub_model(Calendar,
:name => "Name",
:public => 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(/Name/)
rendered.should match(/false/)
end
end

View File

@@ -0,0 +1,20 @@
require 'spec_helper'
describe "calentries/edit" do
before(:each) do
@calentry = assign(:calentry, stub_model(Calentry,
:summary => "MyString",
:typ => 1
))
end
it "renders the edit calentry form" do
render
# Run the generator again with the --webrat flag if you want to use webrat matchers
assert_select "form[action=?][method=?]", calentry_path(@calentry), "post" do
assert_select "input#calentry_summary[name=?]", "calentry[summary]"
assert_select "input#calentry_typ[name=?]", "calentry[typ]"
end
end
end

View File

@@ -0,0 +1,23 @@
require 'spec_helper'
describe "calentries/index" do
before(:each) do
assign(:calentries, [
stub_model(Calentry,
:summary => "Summary",
:typ => 1
),
stub_model(Calentry,
:summary => "Summary",
:typ => 1
)
])
end
it "renders a list of calentries" do
render
# Run the generator again with the --webrat flag if you want to use webrat matchers
assert_select "tr>td", :text => "Summary".to_s, :count => 2
assert_select "tr>td", :text => 1.to_s, :count => 2
end
end

View File

@@ -0,0 +1,20 @@
require 'spec_helper'
describe "calentries/new" do
before(:each) do
assign(:calentry, stub_model(Calentry,
:summary => "MyString",
:typ => 1
).as_new_record)
end
it "renders new calentry form" do
render
# Run the generator again with the --webrat flag if you want to use webrat matchers
assert_select "form[action=?][method=?]", calentries_path, "post" do
assert_select "input#calentry_summary[name=?]", "calentry[summary]"
assert_select "input#calentry_typ[name=?]", "calentry[typ]"
end
end
end

View File

@@ -0,0 +1,17 @@
require 'spec_helper'
describe "calentries/show" do
before(:each) do
@calentry = assign(:calentry, stub_model(Calentry,
:summary => "Summary",
: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(/Summary/)
rendered.should match(/1/)
end
end