require 'spec_helper'

describe ApiAppFeaturesController, type: :controller do
  render_views

  let(:user) { FactoryGirl.create(:user) }

  before(:each) do
    controller.current_user = user
  end

  describe "index" do
    it "returns app features of env" do
      FactoryGirl.create(:app_feature, env: 'production')
      get :index, env: 'production'
      response.should be_success
      json = JSON.parse(response.body, :symbolize_names => true)
      json.should have(1).item
    end
  end

end