Sha256: b21f80bbdb57c57d94fb90f3dd059328da13f2e8df7314485352f934bbb17827

Contents?: true

Size: 887 Bytes

Versions: 2

Compression:

Stored size: 887 Bytes

Contents

require 'rails_helper'

RSpec.describe "project_assignments/new", type: :view do
  let(:user){ FactoryGirl.create(:user) }
  let(:project){ FactoryGirl.create(:project, owner: user) }
  before(:each) do
    assign(:project_assignment, FactoryGirl.build(:project_assignment, project: project, user: user))
  end

  it "renders new project_assignment form" do
    render

    assert_select "form[action=?][method=?]", project_assignments_path, "post" do
      assert_select "input#project_assignment_id[name=?]", "project_assignment[id]"
      assert_select "select#project_assignment_project_id[name=?]", "project_assignment[project_id]"
      assert_select "select#project_assignment_user_id[name=?]", "project_assignment[user_id]"
      assert_select_datetime_field :project_assignment, :started_at
      assert_select_datetime_field :project_assignment, :finished_at
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
model_base_generators-0.3.2 example/spec/views/project_assignments/new.html.erb_spec.rb
model_base_generators-0.3.1 example/spec/views/project_assignments/new.html.erb_spec.rb