<commit_before>require 'spec_helper'

describe ImageFactory::BuildsController do
  fixtures :all
  before(:each) do
    @admin_permission = Factory :admin_permission
    @admin = @admin_permission.user
    @tuser = Factory :tuser
    activate_authlogic
  end

  it "update_status should change image status" do
    UserSession.create(@tuser)
    @template = Factory.create(:template)
    @image = Factory.create(:image)
    @request.env["HTTP_ACCEPT"] = "application/xml"

    @image.status.should == "queued"
    post :update_status, :uuid => @image.uuid, :status => 'building'
    @image.reload.status.should == "building"
    response.should be_success
  end

  it "update_status should change provider image status" do
    UserSession.create(@tuser)
    @provider = Factory.create(:mock_provider)
    @template = Factory.create(:template)
    @image = Factory.create(:image)
    @provider_image = Factory.create(:mock_provider_image)
    @request.env["HTTP_ACCEPT"] = "application/xml"

    @provider_image.status.should == "complete"<commit_msg>BUGFIX: apparently I missed switching one complete to completed.<commit_after>require 'spec_helper'

describe ImageFactory::BuildsController do
  fixtures :all
  before(:each) do
    @admin_permission = Factory :admin_permission
    @admin = @admin_permission.user
    @tuser = Factory :tuser
    activate_authlogic
  end

  it "update_status should change image status" do
    UserSession.create(@tuser)
    @template = Factory.create(:template)
    @image = Factory.create(:image)
    @request.env["HTTP_ACCEPT"] = "application/xml"

    @image.status.should == "queued"
    post :update_status, :uuid => @image.uuid, :status => 'building'
    @image.reload.status.should == "building"
    response.should be_success
  end

  it "update_status should change provider image status" do
    UserSession.create(@tuser)
    @provider = Factory.create(:mock_provider)
    @template = Factory.create(:template)
    @image = Factory.create(:image)
    @provider_image = Factory.create(:mock_provider_image)
    @request.env["HTTP_ACCEPT"] = "application/xml"

    @provider_image.status.should == "completed"
{'fraction_non_alphanumeric': 0.1171003717472119, 'fraction_numerical': 0.0, 'mean_word_length': 4.329207920792079, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5705884', 'n_tokens_mistral': 644, 'n_tokens_neox': 631, 'n_words': 141}