Make Widget::Card translatable

This commit is contained in:
Javi Martín
2018-09-26 15:55:36 +02:00
parent 2c22ab347d
commit 5bb5cfa7fb
7 changed files with 72 additions and 19 deletions

View File

@@ -7,14 +7,19 @@ feature 'Cards' do
login_as(admin)
end
it_behaves_like "translatable",
"widget_card",
"edit_admin_widget_card_path",
%w[title description link_text label]
scenario "Create", :js do
visit admin_homepage_path
click_link "Create card"
fill_in "widget_card_label", with: "Card label"
fill_in "widget_card_title", with: "Card text"
fill_in "widget_card_description", with: "Card description"
fill_in "widget_card_link_text", with: "Link text"
fill_in "widget_card_label_en", with: "Card label"
fill_in "widget_card_title_en", with: "Card text"
fill_in "widget_card_description_en", with: "Card description"
fill_in "widget_card_link_text_en", with: "Link text"
fill_in "widget_card_link_url", with: "consul.dev"
attach_image_to_card
click_button "Create card"
@@ -59,10 +64,10 @@ feature 'Cards' do
click_link "Edit"
end
fill_in "widget_card_label", with: "Card label updated"
fill_in "widget_card_title", with: "Card text updated"
fill_in "widget_card_description", with: "Card description updated"
fill_in "widget_card_link_text", with: "Link text updated"
fill_in "widget_card_label_en", with: "Card label updated"
fill_in "widget_card_title_en", with: "Card text updated"
fill_in "widget_card_description_en", with: "Card description updated"
fill_in "widget_card_link_text_en", with: "Link text updated"
fill_in "widget_card_link_url", with: "consul.dev updated"
click_button "Save card"
@@ -99,10 +104,10 @@ feature 'Cards' do
visit admin_homepage_path
click_link "Create header"
fill_in "widget_card_label", with: "Header label"
fill_in "widget_card_title", with: "Header text"
fill_in "widget_card_description", with: "Header description"
fill_in "widget_card_link_text", with: "Link text"
fill_in "widget_card_label_en", with: "Header label"
fill_in "widget_card_title_en", with: "Header text"
fill_in "widget_card_description_en", with: "Header description"
fill_in "widget_card_link_text_en", with: "Link text"
fill_in "widget_card_link_url", with: "consul.dev"
click_button "Create header"
@@ -135,4 +140,4 @@ feature 'Cards' do
make_visible: true)
expect(page).to have_field('widget_card_image_attributes_title', with: "clippy.jpg")
end
end
end