You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.1 KiB
39 lines
1.1 KiB
require 'rails_helper'
|
|
|
|
module Legacy
|
|
RSpec.describe "legacy/questions/edit", type: :view do
|
|
before(:each) do
|
|
@question = assign(:question, Question.create!(
|
|
:text => "MyString",
|
|
:option1 => "MyString",
|
|
:option2 => "MyString",
|
|
:option3 => "MyString",
|
|
:option4 => "MyString",
|
|
:option5 => "MyString",
|
|
:category_id => 1
|
|
))
|
|
end
|
|
|
|
it "renders the edit question form" do
|
|
render
|
|
|
|
assert_select "form[action=?][method=?]", legacy_question_path(@question), "post" do
|
|
|
|
assert_select "input#question_text[name=?]", "question[text]"
|
|
|
|
assert_select "input#question_option1[name=?]", "question[option1]"
|
|
|
|
assert_select "input#question_option2[name=?]", "question[option2]"
|
|
|
|
assert_select "input#question_option3[name=?]", "question[option3]"
|
|
|
|
assert_select "input#question_option4[name=?]", "question[option4]"
|
|
|
|
assert_select "input#question_option5[name=?]", "question[option5]"
|
|
|
|
assert_select "input#question_category_id[name=?]", "question[category_id]"
|
|
end
|
|
end
|
|
end
|
|
end
|