Bug 16053: Add tests
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 11 Mar 2016 11:32:22 +0000 (11:32 +0000)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Mon, 21 Mar 2016 21:35:04 +0000 (21:35 +0000)
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
t/db_dependent/Koha/Acquisition/Currencies.t

index 3e919af..7e77593 100644 (file)
@@ -18,7 +18,7 @@
 # along with Koha; if not, see <http://www.gnu.org/licenses>.
 
 use Modern::Perl;
-use Test::More tests => 6;
+use Test::More tests => 7;
 use Koha::Database;
 use Koha::Acquisition::Currency;
 use Koha::Acquisition::Currencies;
@@ -56,6 +56,10 @@ is( Koha::Acquisition::Currencies->search->count, $nb_of_currencies + 2, 'The 2
 my $retrieved_currency_2 = Koha::Acquisition::Currencies->find( $new_currency_2->currency );
 is( $retrieved_currency_2->active, 1, 'Active should have been set to 1' );
 
+$retrieved_currency_2->store;
+$retrieved_currency_2 = Koha::Acquisition::Currencies->find( $new_currency_2->currency );
+is( $retrieved_currency_2->active, 1, 'Editing the existing active currency should not remove its active flag' );
+
 my $active_currency = Koha::Acquisition::Currencies->get_active;
 is ( $active_currency->currency, $retrieved_currency_2->currency, 'The active currency should be the last one marked as active' );