Add debates translation interface
Also fix broken spec after removing translatable attributes from strong_parameters definition. Now we need to send these attributes as nested translations attributes. Use activerecord.yml title attribute label so form helper could load it from default location.
This commit is contained in:
committed by
voodoorai2000
parent
f77e7df33e
commit
51cda51155
@@ -12,16 +12,19 @@ describe DebatesController do
|
||||
end
|
||||
|
||||
it "creates an ahoy event" do
|
||||
|
||||
debate_attributes = {
|
||||
terms_of_service: "1",
|
||||
translations_attributes: {
|
||||
"0" => {
|
||||
title: "A sample debate",
|
||||
description: "this is a sample debate",
|
||||
locale: "en"
|
||||
}
|
||||
}
|
||||
}
|
||||
sign_in create(:user)
|
||||
|
||||
post :create, params: {
|
||||
debate: {
|
||||
title: "A sample debate",
|
||||
description: "this is a sample debate",
|
||||
terms_of_service: 1
|
||||
}
|
||||
}
|
||||
post :create, debate: debate_attributes
|
||||
expect(Ahoy::Event.where(name: :debate_created).count).to eq 1
|
||||
expect(Ahoy::Event.last.properties["debate_id"]).to eq Debate.last.id
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user