Sha256: 18b31c90c2526c180965440fe87c2cfafc1431e790f54c27d9f47f1fefa0c2aa
Contents?: true
Size: 1.35 KB
Versions: 1
Compression:
Stored size: 1.35 KB
Contents
require 'spec_helper' require "datagrid/rspec" describe Datagrid do #it_should_behave_like 'Datagrid' let(:group) { Group.create!(:name => "Pop") } subject do SimpleReport.new( :group_id => group.id, :name => "Star", :category => "first", :disabled => false, :confirmed => false ) end let!(:entry) { Entry.create!( :group => group, :name => "Star", :disabled => false, :confirmed => false, :category => "first" ) } its(:assets) { should include(entry) } describe ".attributes" do it "should return report attributes" do (subject.filters.map(&:name) + [:order, :descending]).each do |attribute| subject.attributes.should have_key(attribute) end end end describe ".scope" do it "should return defined scope of objects" do subject.scope.should respond_to(:table_name) end context "when not defined on class level" do before(:each) do @scope = SimpleReport.instance_variable_get("@scope") SimpleReport.instance_variable_set("@scope", nil) end after(:each) do SimpleReport.instance_variable_set("@scope", @scope) end it "should raise ConfigurationError" do lambda { subject.scope }.should raise_error(Datagrid::ConfigurationError) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
datagrid-0.2.0 | spec/datagrid_spec.rb |