Skip to content

Commit ef5556b

Browse files
Add feature spec to test editing of globalized fields with only one locale
1 parent 1ae383b commit ef5556b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright (c) 2012-2025, Jungwacht Blauring Schweiz. This file is part of
2+
# hitobito_jubla and licensed under the Affero General Public License version 3
3+
# or later. See the COPYING file at the top-level directory or at
4+
# https://github.com/hitobito/hitobito_jubla.
5+
6+
require "spec_helper"
7+
8+
describe "Globalized input fields", js: true do
9+
let(:group) { groups(:ch) }
10+
11+
before do
12+
sign_in(people(:top_leader))
13+
visit edit_group_path(group)
14+
end
15+
16+
it "should show globalized field without translation option in single language wagon" do
17+
expect(page).to have_css("input[id^='group_privacy_policy_title']", count: 1, visible: false)
18+
expect(page).not_to have_css("button[data-action='globalized-fields#toggleFields']")
19+
20+
fill_in "group_privacy_policy_title", with: "Some privacy policy title"
21+
expect(page).not_to have_content("Zusätzlich ausgefüllte Sprachen")
22+
23+
click_button("Speichern")
24+
expect(page).to have_content("Gruppe #{group.name} wurde erfolgreich aktualisiert")
25+
expect(group.reload.privacy_policy_title_translations).to eql({de: "Some privacy policy title"}.stringify_keys)
26+
end
27+
end

0 commit comments

Comments
 (0)