AutoCommit Don Sep 3 16:03:01 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-09-03 16:03:01 +02:00
parent 984e5f4b56
commit f7ad93c398
6 changed files with 164 additions and 142 deletions

View File

@@ -1,30 +1,35 @@
require 'spec_helper'
describe "fetprofiles/new" do
describe "fetprofiles/new", :type=> :view do
foreach_theme 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)
@fetprofile = FactoryGirl.create(:fetprofile_withadress,:skype => "myskypename")
@memberships = []
end
it "renders new fetprofile form" do
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=?]", 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]"
expect(rendered).to have_tag('form', with: {method:"post"}) do
with_tag "input", with: {name: "fetprofile[vorname]"}
with_tag "input", with: {name: "fetprofile[nachname]"}
with_tag "input", with: {name: "fetprofile[short]"}
with_tag "textarea", with: {name: "fetprofile[desc]"}
with_tag "input", with: {name: "fetprofile[picture]"}
with_tag "input", with: {name: "fetprofile[picture_cache]"}
with_tag "input", with: {name: "fetprofile[street]"}
with_tag "input", with: {name: "fetprofile[plz]"}
with_tag "input", with: {name: "fetprofile[city]"}
with_tag "input", with: {name: "fetprofile[hdynr]"}
with_tag "input", with: {name: "fetprofile[telnr]"}
with_tag "input", with: {name: "fetprofile[skype]"}
with_tag "input", with: {name: "fetprofile[birth_day]"}
with_tag "input", with: {name: "fetprofile[birth_month]"}
end
end
end
end