diff options
| author | Marc Florisson | 2015-02-20 22:47:40 +0100 |
|---|---|---|
| committer | Marc Florisson | 2015-02-20 22:47:40 +0100 |
| commit | 02f74a895542ef2be54221f3c58fc67777cfe33e (patch) | |
| tree | ddc8089aab5378b138110c8625a1725910da5eea /spec | |
| parent | 9730870608fc78a94a8367d8ab508ee23a9d20b6 (diff) | |
| download | chouette-core-02f74a895542ef2be54221f3c58fc67777cfe33e.tar.bz2 | |
fix spec for rule_parameter_set refactoring
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/controllers/rule_parameter_sets_controller_spec.rb | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/spec/controllers/rule_parameter_sets_controller_spec.rb b/spec/controllers/rule_parameter_sets_controller_spec.rb index 99a522581..7a1d61b29 100644 --- a/spec/controllers/rule_parameter_sets_controller_spec.rb +++ b/spec/controllers/rule_parameter_sets_controller_spec.rb @@ -4,31 +4,33 @@ describe RuleParameterSetsController do login_user let(:mode){"air"} - shared_examples_for "referential dependant" do - it "assigns referential as @referential" do - assigns[:referential].should == referential + shared_examples_for "organisation dependant" do + it "assigns rule_parameter_set.organisation as current organisation" do + assigns[:rule_parameter_set].organisation_id.should == organisation.id end end describe "GET /index" do before(:each) do - get :index, - :referential_id => referential.id + get :index + end + it "should assign rule_parameter_sets to organisation rule_parameter_sets" do + assigns[:rule_parameter_sets].size.should == organisation.rule_parameter_sets.size + assigns[:rule_parameter_sets].each do |rps| + rps.organisation_id.should == organisation.id + end end - it_behaves_like "referential dependant" end describe "GET /new" do before(:each) do - get :new, - :referential_id => referential.id + get :new end - it_behaves_like "referential dependant" + it_behaves_like "organisation dependant" it "should assign rule_parameter_set with default params" do RuleParameterSet.default_params.each do |k,v| assigns[:rule_parameter_set].send( k ).should == v end - assigns[:rule_parameter_set].referential_id.should == referential.id end end end |
