calendar feature generiert
This commit is contained in:
20
spec/views/calendars/edit.html.erb_spec.rb
Normal file
20
spec/views/calendars/edit.html.erb_spec.rb
Normal 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
|
||||
23
spec/views/calendars/index.html.erb_spec.rb
Normal file
23
spec/views/calendars/index.html.erb_spec.rb
Normal 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
|
||||
20
spec/views/calendars/new.html.erb_spec.rb
Normal file
20
spec/views/calendars/new.html.erb_spec.rb
Normal 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
|
||||
17
spec/views/calendars/show.html.erb_spec.rb
Normal file
17
spec/views/calendars/show.html.erb_spec.rb
Normal 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
|
||||
20
spec/views/calentries/edit.html.erb_spec.rb
Normal file
20
spec/views/calentries/edit.html.erb_spec.rb
Normal 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
|
||||
23
spec/views/calentries/index.html.erb_spec.rb
Normal file
23
spec/views/calentries/index.html.erb_spec.rb
Normal 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
|
||||
20
spec/views/calentries/new.html.erb_spec.rb
Normal file
20
spec/views/calentries/new.html.erb_spec.rb
Normal 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
|
||||
17
spec/views/calentries/show.html.erb_spec.rb
Normal file
17
spec/views/calentries/show.html.erb_spec.rb
Normal 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
|
||||
Reference in New Issue
Block a user