require 'spec_helper'

describe 'Fixxpert remove a comment for customer' do
  it 'should remove the comment' do
    fixxpert = create :fixxpert
    customer = create :customer

    # Need some comment to allow fixxpert to access to a customer profile
    comment = create :comment, user: customer, for_user: fixxpert
    fixxpert_comment = create :comment, user: fixxpert, for_user: customer, text: 'Fixxpert comment'
    login_as_user fixxpert

    click_link 'fixxpert_customers_link'
    click_link "show_contacted_customer_#{customer.id}"

    click_link "delete_comment_#{fixxpert_comment.id}"
    page.should_not have_content fixxpert_comment.text
  end

end
