require 'rails_helper' feature 'Poll Questions' do scenario 'Lists questions from proposals before regular questions' do poll = create(:poll) normal_question = create(:poll_question, poll: poll) proposal_question = create(:poll_question, proposal: create(:proposal), poll: poll) visit poll_path(poll) expect(proposal_question.title).to appear_before(normal_question.title) end end