I have a feature test that is trying to validate an edit action. It's a super simple test but I have not written very many and I'm making some mistake that I can't figure out. Basically, when the page is visited it's not rendering the info that is text that is intended to edit and the "update" button is not there. Here is my error and code for clarity.
TEST
scenario "Staff can edit the response messages" do
group = Group.create!(name: "Group A", response: "You are now subscribed for updates")
visit "/groups/#{group.id}/edit"
user = FactoryGirl.create(:user)
fill_in "Email", with: user.email
fill_in "Password", with: user.password
click_button "Sign in"
expect(page).to have_content("You are now subscribed for updates")
end
VIEW
<div class="container text-center">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 well">
<%= form_for @group do |form| %>
<div class="form-group">
<%= form.label :body, "Edit The Response:", class: "message_label"%>
<%= form.text_field :response, class: "form-control", placeholder: "New things are happening!" %>
</div>
<%= form.submit "Update", class: "btn btn-primary" %>
<% end %>
</div>
</div>
</div>
What is even more strange is when I run "save_and_open_page" the content I expect is present? But, my test still fails saying expected content is not displayed WEIRD!