(tests) Fix derive_enum test to actually test custom names

This commit is contained in:
theduke 2017-12-02 05:00:20 +01:00
parent 709231dc46
commit b1a62d68e9

View file

@ -9,7 +9,7 @@ use juniper::{self, FromInputValue, GraphQLType, InputValue, ToInputValue};
enum SomeEnum { enum SomeEnum {
Regular, Regular,
#[graphql(name = "FULL", description = "field descr", deprecated = "depr")] #[graphql(name = "full", description = "field descr", deprecated = "depr")]
Full, Full,
} }
@ -33,9 +33,9 @@ fn test_derived_enum() {
); );
// Test FULL variant. // Test FULL variant.
assert_eq!(SomeEnum::Full.to_input_value(), InputValue::String("FULL".into())); assert_eq!(SomeEnum::Full.to_input_value(), InputValue::String("full".into()));
assert_eq!( assert_eq!(
FromInputValue::from_input_value(&InputValue::String("FULL".into())), FromInputValue::from_input_value(&InputValue::String("full".into())),
Some(SomeEnum::Full) Some(SomeEnum::Full)
); );
} }